j2emanue
j2emanue

Reputation: 62529

FCM - When setting icon in meta data, should I use the mipmap folder?

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?

Upvotes: 3

Views: 5022

Answers (1)

ANAND SONI
ANAND SONI

Reputation: 675

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.

Upvotes: 6

Related Questions