Firebase Notification Always shows blank icon

Mahdi picture Mahdi · Oct 3, 2016 · Viewed 21.7k times · Source

I'm new with FCM. I cannot make FCM use my app icon as notification icon and the icon is always a white blank one.

I imported an icon to mipmap folders but nothing seems changed. As some dude say that this is because of lollipop notification as in this question

But the problem is, the FCM notification automatically pops up and I cannot get the Notification builder to override the icon. How can I change it?

Answer

Aniket Dhandhukia picture Aniket Dhandhukia · Feb 16, 2017

This is the default behaviour of FCM. When app is in background it will take white icon.

Use this tag and put it in your Manifest. For me this worked. Hope it works for you too

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