Struggling to see why there isn't a getInitialNotification anymore on iOS #563
-
Hello, may I ask why getInitialNotification from RNFB is not handled anymore and now it's all inside the "PRESS" handler? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This happened right as the repository here transitioned from a commercial project to a fully open source one. In brief, the app transitions from inactive to active at exactly the moment the notification is pressed, sometimes triggering press events, sometimes triggering initial notification. The duplicate events were troublesome. The press event is most important though as it may be some action the user took, containing more information than just the initial notification, so it seems the best to listen to. You can still use, for example, react-native's initial notification to see if it was an initial notification and de-conflict the two. Or, if the app is just booting that typically implies navigation is not mounted yet anyway, so you can't navigate to whatever the notification wants to take you to anyway. In my case, I maintain a queue of pending navigation events harvested from all initial sources (initial dynamic link, initial notification, any notification presses) and once navigator is mounted and ready to navigate, I determine what the highest priority pending navigation is then do that. In that sense then, it all still works |
Beta Was this translation helpful? Give feedback.
This happened right as the repository here transitioned from a commercial project to a fully open source one. In brief, the app transitions from inactive to active at exactly the moment the notification is pressed, sometimes triggering press events, sometimes triggering initial notification.
#136
The duplicate events were troublesome. The press event is most important though as it may be some action the user took, containing more information than just the initial notification, so it seems the best to listen to.
You can still use, for example, react-native's initial notification to see if it was an initial notification and de-conflict the two.
Or, if the app is just booting that typically …