i am using FCM in ionic 3. I am getting notification properly when the app is in foreground. When I receive a notification in background i am getting the data in the notification only after tapping the notification. But i want to get the data without tapping on the notification. For example see the below code.
this.fcm.onNotification().subscribe(data => {
if(data.wasTapped){
console.log("Received in background");
} else {
console.log("Received in foreground");
};
});
Here i am getting data if data.wasTrapped is true else in the foreground. My problem is to get data without tapping the notification when the app is in background
来源:https://stackoverflow.com/questions/51946934/how-to-handle-fcm-background-notification-without-tapping-on-it-in-ionic-3