Handling notifications when app is closed
See original GitHub issueOn iOS handling notifications that launch the app is relatively straightforward to use
PushNotificationIOS.getInitialNotification().then((notification) => {
//bootstrapping logic
})
However, what would be the equivalent API to use in this library here? The idea is that one should be able to capture the data the notification is coming with before the app is launched ( whether it exists or not ) so that then the app can appropriately route, bootstrap etc.
From my understanding of the documentation doing this isnt clear to me yet, i would be grateful if you could point me to the right direction and i shall submit a PR on the documentation as this seems to be a very common use case.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:8
Top Results From Across the Web
Push Notifications when app is closed - android - Stack Overflow
Yes, it is possible 'to receive notifications from google cloud message when the application is fully closed'. Infact, A broadcast receiver ...
Read more >Push notifications when the App is closed - Apple Developer
I have problem, my app is fully closed or the user closed the app, it is really dead, push notifications do not arrive...
Read more >How to handle Push Notifications when the app is closed?
This works great when the app is open in the background. Although if I close the app, and trigger a push notification, then...
Read more >How to notify users when the application is closed in xamarin ...
I am developing an example app based on notifications , with concepts (websockets SignalR ). all working fine , but when applications are...
Read more >Android push notification not working when the app is closed
So the situation is like, all are getting the notification as per their custom modification done in the app but some devices are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am also having this problem. onNotification is not being called when the app is closed.
I’ve been struggling with this concept for some time now and have just figured it out. I knew it was possible because whatsapp/facebook can be opened from a notification and we are directed to a specific page based on the notification content.
PushNotificationIOS.getInitialNotification() works as long as it’s called outside PushNotification.configure in your index.js.
To access the data passed in the notification simply use:
PushNotificationIOS.getInitialNotification().then((notification) => { const yourNotificationData = notificaton._data })