[Android FCM] Incomplete/missing notifications

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:

  1. 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.

  2. 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:

  1. 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 the getMessage() (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?

Author: Fantashit

3 thoughts on “[Android FCM] Incomplete/missing notifications

  1. 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.

    screen shot 2017-06-21 at 22 03 26

  2. 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:

    "notification": {
    	"title": "Title",
    	"body": "Body",
    	"click_action": "open_event_action"
    },
    "data": {
    	"eventId": "1",
    	"read": "false"
    }

    then modify AndroidManifest file by adding intent-filter for that click action.

    <activity
    android:name=".MainActivity"
    android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
    android:screenOrientation="portrait"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:background="@color/background"
    android:launchMode="singleTop"
    >
    <intent-filter>
    	<action android:name="open_event_action" />
    	<category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>

Comments are closed.

[Android FCM] Incomplete/missing notifications

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:

  1. 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.

  2. 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:

  1. 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 the getMessage() (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?

Author: Fantashit

3 thoughts on “[Android FCM] Incomplete/missing notifications

  1. 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.

    screen shot 2017-06-21 at 22 03 26

  2. 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:

    "notification": {
    	"title": "Title",
    	"body": "Body",
    	"click_action": "open_event_action"
    },
    "data": {
    	"eventId": "1",
    	"read": "false"
    }

    then modify AndroidManifest file by adding intent-filter for that click action.

    <activity
    android:name=".MainActivity"
    android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
    android:screenOrientation="portrait"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:background="@color/background"
    android:launchMode="singleTop"
    >
    <intent-filter>
    	<action android:name="open_event_action" />
    	<category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>

Comments are closed.

[Android FCM] Incomplete/missing notifications

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:

  1. 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.

  2. 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:

  1. 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 the getMessage() (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?

Author: Fantashit

1 thought on “[Android FCM] Incomplete/missing notifications

  1. 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:

    "notification": {
    	"title": "Title",
    	"body": "Body",
    	"click_action": "open_event_action"
    },
    "data": {
    	"eventId": "1",
    	"read": "false"
    }

    then modify AndroidManifest file by adding intent-filter for that click action.

    <activity
    android:name=".MainActivity"
    android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
    android:screenOrientation="portrait"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:background="@color/background"
    android:launchMode="singleTop"
    >
    <intent-filter>
    	<action android:name="open_event_action" />
    	<category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>

Comments are closed.