react-native-push-notification: Callback not triggered when notification is opened and app is killed
I’m having an issue with the onNotification
callback not being called if the app is killed and the notification is clicked. Is there anyway to implement this functionality in the app?
RN -> 0.30.0 react-native-push-notification -> 2.0.2
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 16
- Comments: 37 (4 by maintainers)
Ok, so I managed to work around the issue. However, I’m running a version behind you guys, but it might still work for you. RN -> 0.29.0 react-native-push-notification -> 2.0.1
And in my onRegister method, I did:
@jakkra this solution still works in 3.0.2 (Android), however popInitialNotification needs to called from the UI (a component) rather than onRegister event handler
same here
@Mura7 There is an issue react-native-community/push-notification-ios#106 on
addEventListener
. The library is a simple proxy for this part, and doesn’t include iOS specific implementation: index.js#L84Any final solution for @japesh trick ?
Edit: Even with your hack, my onNotification is never called when my app is in background or killed.
@nollymar So it’s the same answer as Mura7: https://github.com/zo0r/react-native-push-notification/issues/161#issuecomment-617674536
And also: https://github.com/react-native-community/push-notification-ios/issues/102