ff .n
ff .n

Reputation: 211

icon notification in statusbar in flutter

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?

Upvotes: 2

Views: 10767

Answers (2)

Ashnet
Ashnet

Reputation: 428

Attention! icon background must be transparent to be shown as notification icon.

Upvotes: 3

Nazarudin
Nazarudin

Reputation: 1067

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.

Upvotes: 4

Related Questions