Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70432

FCM notifications not triggering onNotification method while app in background

$
0
0

@dikwata wrote:

I am using @ionic-native/fcm. I can get notifications on the notification tray but the onNotification method is not called while receiving the notification. It is only called when the notification is tapped on the notification tray. below is the code I’ am using:

this.fcm.onNotification().subscribe(data => {
if(data.wasTapped){

} else {

};
});

My payload for notification is as follows:
{
“notification”:{
“title”:“My notification”,
“body”:“My notification body”,
“sound”:“default”,
“click_action”:“FCM_PLUGIN_ACTIVITY”,
“icon”:“fcm_push_icon”
},
“data”:{
“param1”:“value1”,
},
“to”:"/topics/topicExample",
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70432

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>