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')) {