Flutter: Android notification icon displays white

1.5k Views Asked by At

I'm using flutter_launcher_icons package to generate launcher icons for the apps. Everything works as expected, the launchers are generated and set for Android and iOS. However, on Android push notifications, the launcher is displayed as a white square, even though the icon is black.

I tried to add the icon as meta-data on the manifest file as well as with the Notification builder as a small icon, the result is the same.

Here's the output from my pubspec.yaml file

flutter_icons:
android: true
ios: true
image_path_android: "assets/icon/ic_logo_new.png"
image_path_ios: "assets/icon/ic_logo_new.png"
remove_alpha_ios: true
adaptive_icon_background: "assets/icon/ic_launcher_background.png"
adaptive_icon_foreground: "assets/icon/ic_logo_new.png"

Is there anyone who faced this issue? Any help is appreciated.

1

There are 1 best solutions below

3
On

just add custom icon to incoming notification.

Just add a meta-data inside tag in your manifest file. Reference

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="When Coin"
    android:icon="@mipmap/ic_launcher">
<meta-data
   android:name="com.google.firebase.messaging.default_notification_icon"
   android:resource="@mipmap/ic_stat_ic_notification" />