android Firebase Cloud Messages notification icon
Asked Answered
C

3

6

I use FCM in my project and it works pretty well. But there is one issue: on some Android devices instead of coloured application icon (when no custom default icon is set and no icon is set in the notification payload) round gray circle is shown. Why this happens and what kind of icon should I use? Should I set custom default icon using meta-data tag?wrong icon

Cilla answered 11/9, 2020 at 10:15 Comment(1)
#37325551 That will help youBawd
P
4

I know it is old question but I am sure someone can need the answer. Inside application tag in the AndroidManifest.xml file add this lines.

   <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/my_notification_icon" />

and put the file called my_notification_icon.png file in the /res/drawable folder.

Phalanger answered 25/2, 2022 at 17:31 Comment(0)
A
0

It's july 2023 and I have exactly the same problem. I added the meta-data, tried different icon sizes, tried drawable and drawable-v21 directories but nothing works. I found out the problem is the picture. The Flutter default icon works. My icon doesn't. I don't know why at the moment but I hope it helps you.

Aposematic answered 10/7, 2023 at 20:42 Comment(0)
G
0

I had this problem and it was because I entered the <meta-data> tag incorrectly. It must go inside the <application> tag.

<application ......
<meta-data       
     android:name="com.google.firebase.messaging.default_notification_icon"
     android:resource="@mipmap/ic_notification" />
</application>
Gelsemium answered 12/9 at 21:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.