Home > Back-end >  icon notification in statusbar in flutter
icon notification in statusbar in flutter

Time:05-22

I use flutter_local_notification for manage fcm notification in flutter. for show icon in StatusBar, add logo png file in drawable and use it.

my image is white, when StatusBar is white, icon not appears. another apps like whatsapp, notification icon color changed based Appbar color. How to solve this problem?

CodePudding user response:

try generate the icon for your notification using this link https://romannurik.github.io/AndroidAssetStudio/icons-notification.html then make sure you has defined the icon in your initializatuon, example for Android:

const AndroidInitializationSettings('@drawable/ic_firebase_notification');

and add this code inside the application tag in AndroidManifext.xml file.

<!-- Add custom icon to the notifications -->
<meta-data android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_firebase_notification" />

and don't forget to put the icon that you generated before to android/app/src/main/res/drawable/ folder. i tried this before, and it worked like a charm in my case.

  • Related