I want to automatically open app when receive push notification. I\'ve tried but it still does not work as I expected. This code below is work when the app is active or in M
This is something need to handle from backend,
Here is a sample payload you are using right now,
{
"message":{
"token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"notification":{
"title":"Portugal vs. Denmark",
"body":"great match!"
}
}
}
Which will only give you control to manipulate and do some action when your app will be in foreground otherwise just raise notification.
In details you can check here.
Now, To always get control over your notification, you need payload like following,
{
"message":{
"token":"bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"data":{
"Nick" : "Mario",
"body" : "great match!",
"Room" : "PortugalVSDenmark"
}
}
}
The difference is you need to send data payload instead of notification poayload from backend.