I am struggling with FCM notifications on Android. The issue is only when the app is closed and not running. I am trying to achieve no click activity I don\'t want the app
One way is to use data
instead of notification
to get onMessageReceived() callback both in app foreground or background. The json part is:
{
"data": {
"title": "notification_title",
"body": "notification_body"
},
"to" : "jh578_gsh....jhHGFJ76FH"
}
For detail, follow this link: https://stackoverflow.com/a/37845174/5829624
Edit:
Method 2:
Use a click_action payload in your notification payload. In json:
{
"notification": {
"click_action": "OPEN_ACTIVITY_1",
},
}
And add this intent filter in the Activity (which you want to load when you tap on the notification) in your Manifest:
Hope this one will solve your problem.