Similar to this question: How do I access remote push notification data on applicationDidBecomeActive?
But the different is how can you access the notification data when you are inapplicationDidBecomeActive
and if you have clicked on the app icon instead of the push notification.
The flow is: If you click on the push notification
then didReceiveRemoteNotification
will be triggered, but if you click on the original app icon, only applicationDidBecomeActive
will be triggered and didReceiveRemoteNotification
will not be called.
I am looking for the later case so how can I access the push notification data.
(Both case assuming the app is in background and not killed yet.)
You can't get remote push payload by launching app from homescreen.
If the push data is important for app use, load it from your server after app launched.