Search code examples
androidflutterfirebase-cloud-messaging

Notification icon on Android shown as a white square


I am using Firebase Cloud Messaging with my Flutter app.

I am sending Push Notifications to my app using the Firebase Console.

My issue is regarding the notification icon on Android.

I have created an icon with Android Asset Studio, as follows:

enter image description here

Then I have included the downloaded assets into their respective folder at android/app/main/res/mipmap.

On Manifest I have included the needed meta-data code:

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

But when sending a notification, a white square is shown.

enter image description here

enter image description here

What am I missing or doing wrong?

Edit:

This my current file:

enter image description here


Solution

  • I think you generated the icons of wrong size. I re-generated them using the android asset studio and seems to be working at my end. You can download then using this link:

    https://romannurik.github.io/AndroidAssetStudio/icons-notification.html#source.type=text&source.text.text=capenergy&source.space.trim=1&source.space.pad=0&name=ic_stat_capenergy