Hi ,
How can I change notification icon and icon area's color when my app in background. Also, I open app and send push,Then onMessageReceived called and I create my custom notification.
Thanks
Hi @tekinarslan you cannot use FCM to set the notification icon at this time, but this is a know issue and the team is working on a fix.
Does this work by now? I only find sources on how to set the default notification icon but not on how to set individual icons.
@einicher You can set the notification icon to any resource in your application via the API (reference). The default notification icon is used when no icon is set in the notification message.
Any resource means, when i have a messages.png icon in my drawable folders and i set icon to messages.png it should work? Cause it does not.
@einicher for example in the sample app, if you remove the default notification metadata from the AndroidManifest.xml then send a notification message without specifying the icon eg:
{
"message": {
"topic": "news",
"notification": {
"title": "Breaking News",
"body": "Catch up on breaking news stories."
}
}
}
The launcher icon is used.
However if you add the icon as a notification override specifying the resource ic_stat_ic_notification which represents ic_stat_ic_notification.png eg:
{
"message": {
"topic": "news",
"notification": {
"title": "Breaking News",
"body": "Catch up on breaking news stories."
},
"android": {
"notification": {
"icon": "ic_stat_ic_notification"
}
}
}
}
The resource image is used as the icon.
Most helpful comment
@einicher for example in the sample app, if you remove the default notification metadata from the AndroidManifest.xml then send a notification message without specifying the icon eg:
The launcher icon is used.
However if you add the icon as a notification override specifying the resource
ic_stat_ic_notificationwhich representsic_stat_ic_notification.pngeg:The resource image is used as the icon.