2

I am facing a problem that is very common, but no solution I saw helped me. So, I'm trying to show local notifications.

Everything works except the icon. Following the package's documentation, I added an icon to the drawable, but it doesn't work.

Here is the structure of my folder and the image I want to show

folder structure

Here is my code to initialization

initialization code

I tried many things. I created icons with transparency (using https://romannurik.github.io/AndroidAssetStudio/) and added to the drawable, added the PNG as in the first image.

It only works when I copy the standard icon to the drawable, which is the Flutter logo.

GeekSilva
  • 352
  • 3
  • 17

1 Answers1

0

Documentation of this package is not so clear about it. You need to change name app_icon to the icon file from your res/drawable folder to have an effect of your custom icon. In your case one example can be ic_launcher.png. Specific line in your code for a change is:

const AndroidInitializationSettings initializationSettingsAndroid =
    AndroidInitializationSettings('app_icon');

Note: If your notification icon gets grey then follow this link for solution: https://stackoverflow.com/a/63746521/15236786

Ruslanbek0809
  • 215
  • 1
  • 7