Android FCM notification not showing in system tray

Hello,

My FCM notification is not working when from Intercom, i can send test message from Firebase Console and everything works properly. When message is send by Intercom, notification dosen’t appear in system tray when app is in background. But my FirebaseMessagingService onmessagereceived event always receive the notification.

So i’m lost.

Hey Richard,

Ryan from Intercom support here. Have you completed the steps in this guide?


private final IntercomPushClient intercomPushClient = new IntercomPushClient();

@Override public void onNewToken(String refreshedToken) {
intercomPushClient.sendTokenToIntercom(getApplication(), refreshedToken);
//DO HOST LOGIC HERE
}

public void onMessageReceived(RemoteMessage remoteMessage) {
Map message = remoteMessage.getData();
if (intercomPushClient.isIntercomPush(message)) {
intercomPushClient.handlePush(getApplication(), message);
} else {
//DO HOST LOGIC HERE
}
}

Yes i have done something similar, my user have to register before. So i do sendTokenToIntercom after i register my user. in onNewToken i make a copy of the token.

onMessageReceived is done the same way.

What is handlePush done, is it needed to show notification in system tray ?

Hello @Ryan_Parker,

So any idea for this problem ? And about handlePush method ?

Thank you.

Hey Richard :wave:

Does the message get received in your app by the FirebaseMessagingService onmessagereceived function?

Also, does the message from Intercom make it to the device?

I’d also recommend starting a conversation with a teammate of mine in the Intercom Messenger on your workspace so we can take a deeper dive into your setup and get to the bottom of this for you :+1:

1

I have implemented FCM in my Android application. API send messages using OneSignal to Android devices. Messages are coming through but not showing any icon in the system tray when the app is the background or closed.

So I tested using the Firebase console and OneSignal console.

When the app is in the background or closed using Firebase console I receive a notification in the system tray. Using OneSignal console I do not receive any notification on the system tray.

In my app I do not have any code related to OneSignal. I have only implemented code related to FCM from its documentation.

Any pointers on why sending a message from OneSignal does not show any notification icon.

This is my manifest file I have set the icon to be ic_launcher

<service android:name=".FMS.MyFirebaseMessagingService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>
    <service android:name=".FMS.MyFirebaseInstanceIDService">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@mipmap/ic_launcher" />
    <meta-data
        android:name="com.google.firebase.messaging.default_notification_color"
        android:resource="@color/colorAccent" />