Open jzinrh opened 2 months ago
the same here
onRemoteNotification
should get triggered if/when the app is in foreground.
PushNotificationIOS.getInitialNotification()
is what you're looking for (if you're coming from background i.e opening the app by tapping on the notification)
useEffect(() => {
// Check if the app was opened by a notification
PushNotificationIOS.getInitialNotification().then(notification => {
if (notification) {
const notificationData = notification.getData();
console.log(notificationData);
}
});
}, []);
I'm able to get that working when the app is launched (i.e. after I force close it) from the notification, but not when it's backgrounded.
React Native Version: 0.73.6
Reproduction Steps:
Notes: