Notification not show icon in case of using mipmap

1k views Asked by At

I am handling FCM and Add these metadata to define icon and color for Notification when i use mipmap icon it does not work and display filled rectangle when I use drawable image it is being displayed

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




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

with mipmap with  mipmap

with drawable

with drawable

1

There are 1 answers

0
Mahmoud Mabrok On BEST ANSWER

Problem is Notification icons must have transparent background more explanation

Solution: if you have not a designer you can use this link Image to transparent to get image with transparent background then you use this to get all drawable dimensions get image drawables