Why Onmessagereceived() Method Is Not Passing Intent Properly When The App Is In Background?
Actually I'm trying to pass intent to an activity on click of the push-notification and it's working fine when the app is present in foreground.But when the app is in background al
Solution 1:
i think the problem is because your are sending notification from fcm console !
From the docs
"When your app is in the background on a user's device, notifications are delivered to the system tray. When a user clicks on the notification, the app launcher opens your app. If you want, you can also add client message handling to receive notifications in your app when it is already in the foreground on the user's device."
you should try sending notification with Fcm apis
Hypothesis i think you should not send notification parameter when you are using api just send data parameter and parse the data in your onMessageReceived if you send notification it will delivered to system tray
How to handle notification when app in background in Firebase
Post a Comment for "Why Onmessagereceived() Method Is Not Passing Intent Properly When The App Is In Background?"