Hi,
I’m trying to implement Firebase Cloud Messaging for Android. Unfortunately, I’m not able to handle all the cases required for a functional app. Note: It doesn’t matter whether I send the notification via Cloud Functions of the Notifications Panel in the Firebase Console.
Working:
-
App is not started at all: When opening the app via double-tapping a notification, the notification is coming through via
firebase.messaging().getInitialNotification()
.
Note: The notification’s message text doesn’t show up here, no clue why. -
App is in foreground/active: When the app is in the foreground and a notification is sent, it’s coming through via
firebase.messaging().onMessage()
.
Note: The notification’s message text shows up here.
Not working:
- App is started, but in background: The notification is shown in the panel, but after double-tapping it to bring app into foreground, neither
getInitialNotification()
(okay, makes sense) nor thegetMessage()
(shouldn’t happen) are triggered.
I followed the Android setup guide for FCM step by step, and double-checked before posting this issue. Can anybody help please?
Upgraded to v2, but still same issue.
I’ve inactivated the app, send a push notification and open the app. Even when I click on the notification to open the app I still doesn’t get the fcm object.
+1 same issue.
We also had custom splash screen. Our solution for this issue was to send in notification payload this key
click_action: "open_event_action"
,Notification payload:
then modify AndroidManifest file by adding intent-filter for that click action.