0

I am trying to change the push notification icon when I send a notification from firebase console(while app is in background). I've added the following code to my manifest file:

    <meta-data
        android:name="com.google.firebase.messaging.default_notification_icon"
        android:resource="@drawable/custom_notification_icon" />
    <meta-data
        android:name="com.google.firebase.messaging.default_notification_color"
        android:resource="@color/color_accent" />

Unfortunately, it is still showing the launcher icon. How to solve this?

NB: I am using Firebase SDK 10.2.0

Additionally, How can I customize the statusbar icon when a notification has come ? Please help me guys.

AL.
  • 36,815
  • 10
  • 142
  • 281
noob-Sci-Bot
  • 231
  • 5
  • 18
  • Try making custom notification using the onMessageReceived method from the FirebaseMessagingService , but remember send the data in data payload, not in notification. – Aawaz Gyawali Jun 15 '17 at 08:01
  • Thank you for your quick response. Is there another way to change the notification icon without using `NotificationBuilder` ? The above code works for many people. But what is wrong with mine ? May be the sdk version or something ? – noob-Sci-Bot Jun 15 '17 at 08:07
  • This is so disappointing. SO has been so helpful to me but no response in new questions which is not very common. Is it becoming dead ??!! – noob-Sci-Bot Jun 15 '17 at 08:49
  • here is a good thread that might give you a few good ideas https://stackoverflow.com/questions/37325051/notification-icon-with-the-new-firebase-cloud-messaging-system ...there is mention of using FirebaseMessagingService which might be worth looking into – Isaac Martin Otim Jun 15 '17 at 09:07
  • Still no answers D: – Denny Sep 05 '18 at 08:39

0 Answers0