1

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.

Laura
  • 402
  • 1
  • 7
  • 24

1 Answers1

2

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" />
  • As I mentioned, I've tried this, no luck( – Laura Sep 19 '22 at 11:04
  • @Laura your icon should be ransparent because All colors and non transparent pixels are displayed in white you can also refer this link [https://clevertap.com/blog/fixing-notification-icon-for-android-lollipop-and-above/] – Jayveersinh Mahida Sep 19 '22 at 13:44
  • my icons are transparent, that's why the issue occurs when trying to add adaptive icons – Laura Sep 19 '22 at 16:18