icon notification in statusbar in flutter

Diposting pada

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?

Answer
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.

 26 total views,  1 views today

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *