How to change remote push notification icon for React Native(android) application

Issue

I have followed this link for push notification implementation within my app
https://github.com/zo0r/react-native-push-notification/tree/a359e5c00954aa324136eaa9808333d6ca246171

at present the default app launcher icon is displayed.
I want to change it. Is there any way to do that?

Solution

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",
}) 

Answered By – Mohamed Khalil

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *