-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
added popInitialNotification function #19
base: master
Are you sure you want to change the base?
Conversation
This function allows you to access the "payload" sent with your notification. |
Thanks! One question. |
@oney I didnt realize that could be done. I think that will be a better approach since then we dont need to use an event listener. Also I was thinking that we need to clear that notification after it has been "popped". |
Currently, this module uses https://github.com/Neson/react-native-system-notification to create notification in |
DeviceEventEmitter.addListener('sysNotificationClick' doesnt work when the app is not already open. |
Yeah DeviceEventEmitter.addListener('sysNotificationClick'... only works when the app is open. popInitialNotification would be ideal. |
@RGBz absolutely agree with you. I will remind the author of |
Thinking about it a bit more, a callback-based approach like this implementation of popInitialNotification or DeviceEventEmitter.addListener('sysNotificationClick'... is not what you'd want to handle opening the app via notification because it means the app will:
The PushNotificationIOS.popInitialNotification API returns its value inline which instead of using a callback. This would allow for you to open the app right up to the screen you'd want on the first render pass. @oney What are your thoughts? If you agree I can look into making a popInitialNotification that returns its value inline as well. |
My opinion is same as you, directly get payload from popInitialNotification like PushNotificationIOS.popInitialNotification, not from or on a callback. I have mentioned here. |
I agree, I'll hop over there. Thanks! |
I agree a more inline approach would have been suitable. Wasn't sure how to make that work. |
No description provided.