Open mohamedadlyflyfox opened 3 years ago
Hi @mohamedadlyflyfox,
I hope you have resolved this issue. However, In case someone comes across the same issue, here's the solution.
The issue is that, from Android Lollipop, "Notification icons must be entirely white" [1]. So you have to create entirely white notification icons using Android Studio or I use Ape Tools for this. Then you can set the color for the icon background using
PushNotification.localNotification({
...,
color: "red"
})
References:
I have found the solutions to display the notification icon, if you are using @react-native-firebase/messaging
& react-native-push-notification
libraries to display the remote notification and local notification, please add the following lines to AndroidManifest.xml
file:
<meta-data
android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@color/ic_notification_color" />
<meta-data
android:name="com.dieam.reactnativepushnotification.notification_icon"
android:resource="@drawable/ic_notification" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/ic_notification_color" />
If you are using local notification then please add the smallIcon
field in PushNotificationScheduleObject
for example:
NOTE: @drawable/ic_notification
file must be follow the guidelines provide by Android Developer in link:
http://spot.pcc.edu/~mgoodman/developer.android.com/preview/notifications.html
You can apply the tint colour of notification icon by adding the field messaging_android_notification_color
in firebase.json
file like:
{
"react-native": {
"crashlytics_debug_enabled": true,
"messaging_android_notification_color": "@color/ic_notification_color"
}
}
dear please any one faced this issue before ? in some android devices notification not show get grey color