1

I am using firebase for notification and sending notification using REST Api everything works fine but there is one problem notification icon of statusbar not showing properly always it shows white circle instead of my small icon set for notification. I search a lot eveyone suggest that we can not use colorfull icon in notification but I saw everyone using colorfull icon.


See this image google play,Instagram, and so many application shows there logo

see here

I also attach image that i want to show in notification

see here
also I'm using transparent background but I'm not able to show correctly please help me and my English is very bad I'm sorry for that

Ramesh sambu
  • 3,577
  • 2
  • 24
  • 39
  • 1
    please share your code. – yashkal Jan 03 '18 at 05:13
  • Possible duplicate of [Notification Icon with the new Firebase Cloud Messaging system](https://stackoverflow.com/questions/37325051/notification-icon-with-the-new-firebase-cloud-messaging-system) – ADM Jan 03 '18 at 05:14
  • Possible duplicate of [Android Color Notification Icon](https://stackoverflow.com/questions/45874742/android-color-notification-icon) – Sachin Rajput Jan 03 '18 at 06:25
  • please refer this https://stackoverflow.com/questions/33913952/android-notification-is-not-showing-colour-icon-in-marshmallow – rafeek Jan 03 '18 at 06:28
  • @rafeek ,thunder ..... yes colorful icon is showing in large icon in my case even but main problem is small icon ..... I see all of this link and answer but not got the exact answer or detail about how other application able to show colorful icon in small icon of notificationcompat builder ....Btw thanks all of you – Atul Chaudhary Jan 03 '18 at 06:39
  • @AtulChaudhary what is the os version are you used? – rafeek Jan 03 '18 at 06:43
  • @rafeek nougat and marshmallow – Atul Chaudhary Jan 03 '18 at 06:55
  • can u try fcm meta-data in your manifest file pls refer this – rafeek Jan 03 '18 at 07:16
  • https://github.com/firebase/quickstart-android/blob/master/messaging/app/src/main/AndroidManifest.xml – rafeek Jan 03 '18 at 07:17
  • Yes , I already used manifest default declaration but no luck – Atul Chaudhary Jan 03 '18 at 07:43
  • please refer this https://stackoverflow.com/questions/4265595/android-status-bar-expects-icons-of-size-25x25dp-while-guidelines-recommend-32x3 – rafeek Jan 03 '18 at 10:35
  • please refer this one https://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html#icon11 – rafeek Jan 03 '18 at 10:36

1 Answers1

0

Post android Lollipop release android has changed the guidelines for displaying notification icons in the Notification bar. The official documentation says "Update or remove assets that involve color. The system ignores all non-alpha channels in action icons and in the main notification icon. You should assume that these icons will be alpha-only. The system draws notification icons in white and action icons in dark gray.” Now what that means in lay man terms is "Convert all parts of the image that you don’t want to show to transparent pixels. All colors and non transparent pixels are displayed in white"

Make sure your image file will have in .png format with transparent background

Sunil Soni
  • 443
  • 3
  • 18
  • Yes i read all of this but my question is how other application shows colorful notification icon ....please visit this link and guide me .. https://i.stack.imgur.com/x6SSo.png u can see playstore , insta and so many applications able to show colorful logo inside notification please watch this image first – Atul Chaudhary Jan 03 '18 at 05:39