Reputation: 202
I have a weird problem with @react-native-firebase/messaging. I recently updated to v6 and everything works well on iOS and on Android everything works well except for one thing.
When getting multiple push notifications the following is the case:
getInitialNotification()
gives me the clicked notification, so I can handle itgetInitialNotification()
returns null
It seems like opening the app with one notification eats the data of all the other notifications as well. I guess I'm doing something wrong, but I have no clue where I can search for the issue.
Some information about the setup
getInitialNotification()
in a useEffect
, so after the first render of the navigation treeUpvotes: 2
Views: 3279
Reputation: 252
messaging().onNotificationOpenedApp(remoteMessage => {
console.log(
'Notification caused app to open from background state:',
remoteMessage.notification,
);
navigation.navigate(remoteMessage.data.type);
});
Add this listner
https://rnfirebase.io/messaging/notifications
Upvotes: -1