2

In short, this is what I am getting on Nougat/Oreo - circle (square on Nougat) instead of app icon:

enter image description here

On KitKat app icons shows itself just fine:

enter image description here

I have set default icon for Firebase correctly/Android manifest:

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

Does anybody know why app icon is never shown from FCM notification on recent Android versions? I'm out of ideas, any tips?

[Edit]: As Google suggests, I wanted to be sure to meet material iconography guidelines, so I tested this icon But still only circle/square is shown. What have I ommited?

PRATEEK BHARDWAJ
  • 2,364
  • 2
  • 21
  • 35
user1209216
  • 7,404
  • 12
  • 60
  • 123

2 Answers2

8

It seems that there's a bug in Firebase version 11.8.0 on Oreo. I was facing the same issue, but when I downgraded to version 11.6.2 it worked like a charm.

  • It still does not help. On other project, icon shows itself fine with latest Firebase version. I guess icon content matters somehow, but rules are completly unclear for me. Logcat error message: `E/FirebaseMessaging: Icon with id: 2131492868 uses an invalid gradient. Using fallback icon` downgrading Firebase does not help – user1209216 Feb 12 '18 at 09:23
  • not sure if that's the case, but there are certain guidelines for notification icon [here](https://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html) which you should follow – Grzegorz Matyszczak Feb 12 '18 at 13:00
  • So, it seems to be emulator problem (Android 8.0 emulator from Google). No matter what, always fallback icon is used there. I have also tested my phone (Android 7.1.2) and emulator Android 8.1 (with Google Play) from Google - both are fine, with Firebase version 11.8. Weird. I also was wrong, all my projects have the same problem on 8.0 emulator. Maybe problem it's rather related Google Play Services installed on phone. – user1209216 Feb 15 '18 at 11:26
  • Fixed for me too. – Muhammad Noman Mar 12 '18 at 10:20
0

Icon should be flat (no gradients), white and face-on perspective.

https://material.io/design/iconography/#icon-treatments

Fakhar
  • 3,946
  • 39
  • 35