Hi!! everyone!!.
I develop an app using Ionic 3 with Firebase(https://ionicframework.com/docs/native/fcm/) and background-mode (https://ionicframework.com/docs/native/background-mode/), I using background-mode for receive always the push notification, when app is foreground and I click in tab notification is opened without problemas the page, my problem is when app is background and I click in tab notification only open app without open the specific page.
I put console.log when I receive every notification, in foreground print the information I sended in my backend service, but in background does not print anything.
I using next payload:
{
"notification":{
"title":"title",
"body": "message",
"click_action":'FCM_PLUGIN_ACTIVITY',
"sound":'default'
},
"data":{
"title": "title",
"body": "message",
"param1": "value1",
"param2": "value2"
}
}
Code in Ionic 3:
this.backgroundMode.enable();
this.backgroundMode.on("activate").subscribe(()=>{
this.fcm.onNotification().subscribe( data => {
this.events.publish('notification:created',true);
console.log(data);
if(data.wasTapped){
this.redirectPage(data);
}else{
}
});
});
I sorry for my bad english
Thanks in advance.