Push notifications are working, if the app in the closed state. But not working, if the app is in the foreground.
I am using FCM.
Hi,
I was experiencing the same issue then noticed a difference in the AndroidManifest.xml config.
This fixed it for me
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm
@timbielawski this is for gcm But what to do if I want fcm foreground push notification.
This worked for me:
I updated my AndroidManifest.xml with instructions shown on this page.
https://rnfirebase.io/docs/v4.2.x/messaging/android
This worked for me:
I updated my AndroidManifest.xml with instructions shown on this page.
https://rnfirebase.io/docs/v4.2.x/messaging/android
@zashishz can you explain what you change or can you add androidManifest.xml file here
This worked for me:
I updated my AndroidManifest.xml with instructions shown on this page.
https://rnfirebase.io/docs/v4.2.x/messaging/android@zashishz can you explain what you change or can you add androidManifest.xml file here
@akshgods I made these changes as mentioned in link for AndroidManifest.xml.
<application ...>
<service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
</application>
Change the value to true to enable pop-up for in foreground (remote-only, for local use ignoreInForeground)
Inside meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground"
android:value="true".
@TaraSinghDanu
i change according to doc but it does not work
`
<!-- 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 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" /> <!-- or @android:color/{name} to use a standard color -->
<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" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
</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>
`
make value true if false and use version 5.1.1.
i have same issue in version 6. version 5.1.1 hava all kinds of notifications
Hi @AhmedRazaVerge
Do not ask for rollback versions. The v6 have breaking changes describe in the CHANGELOG and RELEASE NOTE.
Please read documentation before asking rollback.
Dear @Dallas62
i was using the v6.i read the all doc and changelog.
<!-- 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" />
i make changes according to the documentation to get notification pop in foreground but i did not get pop of notification.i just get the notification object.
so i try version 5.1.1 because i am using the this version in another project it works fine.
when i downgrade from v6 to 5.1.1 in current project i work.i get the notification popup.
Hi @AhmedRazaVerge
If you take a look in the last ten issues you will get an answer to this issue.
Regards
Most helpful comment
Change the value to true to enable pop-up for in foreground (remote-only, for local use ignoreInForeground)
Inside meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground"
android:value="true".