Closed RyanSept closed 1 year ago
try all of these to see which gets called
Notifications.events().registerNotificationReceivedForeground((notification, completion) => {
console.log(notification)
});
Notifications.events().registerNotificationReceivedBackground((notification, completion) => {
console.log(notification)
});
Notifications.events().registerNotificationOpened((notification, completion) => {
console.log(notification);
});
Thanks Cheyenne. I already have these callbacks registered, the problem is with the getInitialNotification()
function
// User presses on a notification and it opens the app by launching it
Notifications.getInitialNotification(); -> Notification(...)
// User presses on a notification for a backgrounded app and it opens the app by foregrounding it
Notifications.getInitialNotification(); -> undefined
I think the second scenario should behave similarly to the first
@RyanSept did you manage to find a solution to thus issue?
@blolo I used AsyncStorage to store the notification upon registerNotificationOpened() then when the app rendered I have a callback that checks a notification is present in AsyncStorage and does actions on it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
The issue has been closed for inactivity.
Currently if the app was already running but in the background and the user opens it via a push notification,
getInitialNotification()
returns undefined. Is it possible to set the initial notification to be available when the app is being foregrounded?This was tested on Android 12