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" />

Any pointers would be very helpful. I am not sure if adding any code would help.

Thanks R

BRDroid
  • 3,920
  • 8
  • 65
  • 143
  • https://stackoverflow.com/questions/37876257/push-notification-works-incorrectly-when-app-is-on-background-or-not-running – Tim Feb 22 '18 at 12:51
  • @TimCastelijns that was very helpful, going through it now. I hope that fixes it. will update you shortly – BRDroid Feb 22 '18 at 13:18

0 Answers0