I am trying to get my app to process the DATA payload while it is in the background.
"data": {
"aKey": "aValue",
"customtitle": "my title",
"custombody": "my body",
"customimage": "my image"
},
"notification": {
"title": "my title",
"text": "some text",
"icon": "icon to use",
"sound": "soundtouse"
}
Accroding to the documentation under the section Handle notification messages in a backgrounded app
..the data payload is delivered in the extras of the intent of your launcher Activity.
In my application, the onMessageReceived
only receives a RemoteMessage
object.
I tried overriding the onMessageReceived
signature to accept an Intent
but that doesn't work.
I can find no tutorial or explanation on this other than the the VERY LAST SENTENCE in the documentation.
Can someone tell me where there are examples on how to handle the data payload when the app is in the background or closed?
If the app is open, then it processes the Data payload fine, from my onMessageReceived
(RemoteMessage)` method.