React-native-push-notification: ic_notification under res still renders as white circle

Created on 4 Aug 2017  路  4Comments  路  Source: zo0r/react-native-push-notification

I have talked to my designer and got the android notification icons and saved them under the res\mipmap-*\ folders as ic_notification.png.

I have ensured that my designer is aware of all the requirements of the transparent background and used the icon sizes specified in

/android/app/src/main/res/mipmap-mdpi/ic_notification.png - 24x24
/android/app/src/main/res/mipmap-hdpi/ic_notification.png - 36x36
/android/app/src/main/res/mipmap-xhdpi/ic_notification.png - 48x48
/android/app/src/main/res/mipmap-xxhdpi/ic_notification.png - 72x72
/android/app/src/main/res/mipmap-xxxhdpi/ic_notification.png - 96x96

But still I get the white circle associated with my icon ( circle because my ic_launcher.png is a circle shape icon).

What am I missing here? Appreciate any thoughts.

Stale

Most helpful comment

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 use put all sizes ic_notification in respective folder in resource mipmap folder and add line in AndroidManifest.xml file.
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/ic_notification" />

All 4 comments

Same issue here.. I tested this and it displayed the correct icon for local notifications.

PushNotification.localNotification({
    message: 'Test Message',
    smallIcon: 'ic_notification',
});

Resolved: My issue was because I was using FCM and sending the title, body from the server in the Notification property instead of just using the Data property and using title, message.

notification icons should go under
/android/app/src/main/res/drawable-*

this works for me for remote notifications but not for local notifications (still see the white circle), saving ic_notification images both in drawable and mipmap works for me.

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 use put all sizes ic_notification in respective folder in resource mipmap folder and add line in AndroidManifest.xml file.
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@mipmap/ic_notification" />

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings