Firebase Notification is grey flutter

后端 未结 3 2108
攒了一身酷
攒了一身酷 2021-02-09 12:49

I\'m using Firebase Cloud Messaging to send notifications to my Flutter app. It works fine but my app icon notification is grey on the Google Pixel XL. I can see the outline, b

3条回答
  •  梦如初夏
    2021-02-09 13:34

    I did the following and it worked for me:

    1. Create a transparent and white notification icon (you can use the following tool: AndroidAssetStudio )

    Download the zip folder, unzip and you'll see it contains a res folder with different drawable folders. Copy and paste the contents of the res folder in "android\app\src\main\res" path

    1. Then open the AndroidManifest.xml file and add the following lines to it:

    ic_stat_calendar_today is the name of my notification icon. And each of the drawable folders that have been pasted contain a different size of icon with the same name.

    1. If you want to change the color of the icon then check the above image. Add the metadata tag after the notification icon tag

    2. Go to "android\app\src\main\res\values" and add a colors.xml file

    #00FF00
    

    I have shared this answer in the following Github chain as well- Solution.

提交回复
热议问题