From 4cea8358fc738016b21e9b91296e8332464b73b3 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 19 Sep 2023 10:22:30 +0100 Subject: [PATCH] coment functions --- .../notification/notifications.service.ts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/app/services/notification/notifications.service.ts b/src/app/services/notification/notifications.service.ts index 3aff89bb7..bce1aa448 100644 --- a/src/app/services/notification/notifications.service.ts +++ b/src/app/services/notification/notifications.service.ts @@ -88,6 +88,37 @@ export class NotificationsService { } } + + onReciveForeground() { + + if(this.platform.is('mobile')) { + + if (!this.isPushNotificationsAvailable) { + return false + } + PushNotifications.addListener('pushNotificationReceived', + (notification: PushNotificationSchema) => { + this.active = true + console.log('NOtification Listener', notification) + // this.storenotification(notification) + + + } + ); + + } else { + this.afMessaging.messages.subscribe((notification) => { + // this.storenotification(notification) + // this.notificationReceived.emit(); + // this.eventtrigger.publishSomeData({ + // notification: "recive" + // }) + // Handle the received message, e.g., show a notification + }); + } + } + + onReciveBackground() { if(this.platform.is('mobile')) {