I have an app that uses FCM to send messages between users. I have implemented my FirebaseMessagingService that does something with the data of the RemoteMessage. This is an example of a RemoteMes:
{
"to" : "cZVz2c3uJBg:APA91bHW...",
"data" :{"friend": "mike"},
"notification" : {
"title" : "Paltrack",
"sound" : "true",
"click_action" : "com.woutkl.groep_2.RegActivityStart"
}
}
The first problem i had is that (if this is correct) onMessageReceived is not called when the app is not in foreground. So to do somthing after you click the notification I start that activity, but now i need to access the data from the RemoteMes and i have no idea how to do this.