How to change remote push notification icon for React Native(android) application
You have to follow some rules for notification icon link
First, generate notification icons link of all sizes. and put the icon name ic_notification
.
Then move all sizes ic_notification
in the respective folder in the android/app/main/res/mipmap
folder and add below line in AndroidManifest.xml
file.
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/ic_notification" />
you should first add the new icon in all android/app/src/main/res/mipmap-*
notice in all folders that start mipmap-* add new icon with same name with proper resolution
then in your notification object that send you can add it's name
{
largeIcon: "ic_launcher", // (optional) default: "ic_launcher"
smallIcon: "ic_notification", // (optional) default: "ic_notification" with fallback for "ic_launcher"
}
PushNotification.configure({
largeIcon: "ic_launcher",
smallIcon: "ic_notification",
})
In AndroidManifest.xml add the below line
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/ic_notification" />
create custom icon ic_notification and add them to mipmap and drawable folders