I\'m having an issue with data from the notification when the app is killed data the data which is sent from intent is getting null else if when the app is running I\'m able
Change your request body this like:
{
"data":{
"title" : "your_title",
"body" : "your_body"
},
"to": "device_token",
"priority": "high"
}
and onMessageReceived:
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getData().size() > 0) {
Log.d(TAG, "Message data payload: " + remoteMessage.getData());
String title = remoteMessage.getData().get("title");
String body = remoteMessage.getData().get("body");
sendNotification(title,body); // edit for your self
}
}
now it works when app killed, background and foreground