Hi, I am working on notification and sending it via fcm notification test server ,
here is my code for that.
FCMPlugin.onNotification(
(data) => {
if(!data.wasTapped){
console.log("tapped when killed"+JSON.stringify(data));
}else if (this.platform.is('android')){
this.nav.push(NotificationPage,{data});
console.log("RecivedFromFCM :"+data);
}
},
(e) => {
console.log(e);
}
);
The issue is that it ONLY runs when you tap on the notification from the notification drawer while the app is in the background. So if the app is open and a notification arrives, the function doesn’t run. Basically, “Received in foreground” never fires, even when the app is in the foreground. I want “Received in foreground” to log as soon as a notification arrives, even before tapping it and also when the app is not running I am able to receive notification but on click, it goes directly to homePage but it should have to go notification page.
Any idea how I can accomplish this, please? Or am I missing something?