5
votes

Using the following payload syntax I am trying to achieve a coloured notification:

const payload = {
  notification : {
    title : "App title",
    body : "You have new messages",
    icon : "not_icon_white2",
    color : "#2a6d57",
    sound : "default",
    click_action : "do something"
  }
};

The icon in the status bar is displayed correctly (as white) yet in the notification drawer my notification behaves like this: enter image description here

The title color is correct, yet the notification icon remains white, resulting in a poor visual experience.

I am using (as you can see above) the color attribute in the payload that should change the color of the icon as well.

Official docs:

color Optional, string The notification's icon color, expressed in #rrggbb format.

Why is the notification icon color not changing to the color I specified in the payload?

Could the icon drawable (a white one with transparent portions) be the cause here?

NOTE: This question regards FCM notification payload and NOT data. Also, the question regards the background case of sending the content, not foreground.

1
heyv , ive used exactly your color and the color changed of notification dot - Gaurav Roy

1 Answers

0
votes

you should use capital char as this in your code 'color':'#2A6D57' enter image description here