Remote push notification icon issues android
See original GitHub issueMy push notification works with sound, but I can’t see the large icon for both background and foreground remote notifications.
Also I get this icon when in the foreground. .
AndroidManifest.xml
<!-- PUSH Notification --> <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_notification" /> <meta-data android:name="com.dieam.reactnativepushnotification.notification_icon" android:resource="@drawable/ic_notification" /> <meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="rn-push-notification-channel-id-4-default-300" tools:replace="android:value" /> <!-- Change the value to true to enable pop-up for in foreground (remote-only, for local use ignoreInForeground) --> <meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="true"/> <!-- Change the value to false if you don't want the creation of the default channel --> <meta-data android:name="com.dieam.reactnativepushnotification.channel_create_default" android:value="true"/> <!-- Change the resource name to your App's accent color - or any other color you want --> <meta-data android:name="com.dieam.reactnativepushnotification.notification_color" android:resource="@color/white"/> <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" /> <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" /> <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService" android:exported="false" > <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <!-- PUSH Notification -->
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (1 by maintainers)
Top GitHub Comments
Im having the same problem, icon is not showing in Android when the app is in background and quit. Any solution?
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 toAndroidManifest.xml
file:If you are using local notification then please add the
smallIcon
field inPushNotificationScheduleObject
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.htmlYou can apply the tint colour of notification icon by adding the field
messaging_android_notification_color
infirebase.json
file like: