Can I override default push notification icon in android from app icon to custom icon?
I am using default firebase implementation to display notification in system tray, when a push notification come. Since my app icon is coloured and has gradient, so when a notification comes, android tried to make a black/white version of it, and make it look like a white circle.
Is there a way to update the default notification icon to something else instead of default app icon?
PS: Looking forward for a solution which required a config change in manifest and don't want to use NotificationCompat.Builder
Builder
class forNotification
objects. Provides a convenient way to set the various fields of a Notification and generate content views using the platform's notification layout template. Check Official Documentation hereHere you can set custom fields including Icon for your notifications.
Cheers! Happy Coding
Yes you can do it.If you want to avoid white circle icon you must make your icon transparent and add background color to it.So the color you use appears out through the transparent icon and makes the icon visible and colorful. please check for setSmallIcon and setColor in the below sample code.Check this doc and search for transparent
You can do like this:
You can set
A small icon, set by setSmallIcon()
Set the large icon that is shown in the ticker and notification.
in NotificationCompat.Builder.
Documentation - https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
you can use this in your manifest according to https://firebase.google.com/docs/cloud-messaging/android/receive
Hope it helps people.