3

To set a default icon with FCM we can add a meta tag in the Android manifest. Mine currently looks like below because I'd like to use my application's icon as the notification icon when receiving push notifications:

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

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

Notice I am getting ic_logo_launcher.png from the mipmap folder. Is this advisable?

j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • 1
    I place it in drawable check this link http://stackoverflow.com/questions/28065267/mipmap-vs-drawable-folders but still I think your question is very good. – teck wei Jan 18 '17 at 19:10

1 Answers1

6

Yes ! You can ...though firebase takes app_icon by default

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

But its better to use icon from @drawable which will have alpha and white icon.

ANAND SONI
  • 625
  • 9
  • 13