Closed fgagneten closed 3 months ago
I'm experiencing similar issues. Initially, I had problems with @react-native-firebase/messaging + react-native-push-notification. I switched to @notifee/react-native + @react-native-firebase/messaging and still encounter the same issues. Sometimes it comes through, but it can take up to 30 minutes, and in most cases, it doesn't come through at all until the app is opened.
"react": "18.2.0", "react-native": "0.72.3", "@react-native-firebase/messaging": "14.12.0", "@notifee/react-native": "^7.8.2",
iOS 17.4 (21E219), iphone 11
In the console, nothing happens, and the call to setBackgroundMessageHandler doesn't trigger.
The issue was resolved by updating React Native from version "0.72.3" to "0.73.6".
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
+1
Is this issue resolved? I upgraded my react-native to 0.73.6 as @aburduk said, but it wasn't solved. I am trying to find many ways, Is there anyone who suffer from this problem?
We still having the same issue. Didn't find any solution yet
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
We also encounter this issue. We have configured a setBackgroundMessageHandler. We send a push notification with firebase admin sdk from our backend. The notification has title, body and data, content_available is true. We also have a listener for foreground push notification which looks like this:
useEffect(() => {
const unsubscribeFCMNotification = messaging().onMessage(message => {
// ... some loging
// display the notification
notifee.displayNotification({
title: message.notification?.title,
body: message.notification?.body,
data: message.data,
android: {
sound: 'ding',
channelId: 'general',
smallIcon: 'ic_notification',
color: 'red'
},
ios: {
sound: 'ding.wav'
}
})
.catch(() => {});
});
return () => {
// Clean up the event listeners
unsubscribeFCMNotification();
};
}, [dispatch]);
Sending a push notification with the notification
key from backend, is automatically displayed by the OS, but in some cases the same notification is passed to the messaging().onMessage
listener where we display a local notification.
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Reported the issue at react native firebase: https://github.com/invertase/react-native-firebase/issues/7836
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Issue Summary: We are encountering an issue where iOS users occasionally experience a delay in receiving push notifications until they open the app. The problem seems to be inconsistent, as notifications are generally delivered promptly, but some users report receiving them only after launching the application.
Environment:
@notifee/react-native version: 7.8.0 @react-native-firebase/messaging version: 18.6.1 react-native version: 0.72.6 Additional Context:
We have implemented the setBackgroundMessageHandler in our app, which is utilized to log whether a user receives a notification or not. This helps us determine whether to resend notifications or not to make sure they always receive the notifications.
In the specific case reported, the
setBackgroundMessageHandler
was triggered, as evidenced by the database record indicating that the user received the notification pretty much the same hour/minutes/seconds the notification was delivered)Despite the successful execution of
setBackgroundMessageHandler
, the user claims that the notification was displayed on their device only after opening the app. It's worth noting that the same user received notifications without any issues the previous weeks.Steps to Reproduce: Unfortunately, we haven't been able to consistently reproduce the issue ourselves, making it challenging to identify the root cause.
Expected Behavior: Push notifications should be consistently displayed to users in a timely manner, regardless of whether the app is open or closed.
Actual Behavior: Notifications are occasionally delayed until the user opens the app, even though the setBackgroundMessageHandler has been executed and logged appropriately.
Additional Information: Are there any known compatibility issues between the mentioned library versions? Any insights on potential changes or updates that could address this intermittent delay?
Device reported the error:
ios 16.1.2, iphone 13
This is how I'm displaying the notification (I don't think this is really required due to this is inside the onMessageRecieved that is called on foreground):
And this is the JSON how is configured the firebase notification in the backend:
Thank you for your assistance in resolving this matter. If further details are needed, please don't hesitate to reach out.