I have a example output from the server to push notification to an app which is shown below:
{
"to" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
"notification" : {
"body" : "great match!",
"title" : "Portugal vs. Denmark",
"icon" : "myicon"
},
"data" : {
"Nick" : "Mario",
"Room" : "PortugalVSDenmark"
}
}
How do I store the contents in data when the app is in background as onMessageReceived
is only triggered when the app in in foreground.