I'm getting crazy with apns problem.
I'm testing apns push notification. I could get push messages well.
But now something is big problem. I'd like to tell my circumstance like below.
When my app is running, didReceiveRemoteNotification is called well.
When my app enter background, and got a push message, and then if I touch my app,
didFinishLaunchingWithOptions NOT called.
didReceiveRemoteNotification NOT called.
ONLY applicationDidBecomeActive is called.
So, how could I display arrived push message under circumstance like this?
I couldn't access (NSDictionary *)userInfo
object in applicationDidBecomeActive
method.
I couldn't find any API for accessing userInfo.
It's nonsense that I can't access to arrived push messages when become foreground from background.
So should I retrieve the message from my server again? If I should do like this, why does push message architecture exist? It's unreasonable.
Opening the app by tapping the icon will never give you information about previous notifications. It's only if you actually open the app via a notification that you will be able to access the notification data.
If you tap the icon, how would the app know which notification you are responding to, if there were multiple recent notifications? How would the app know the user is even responding to a notification at all, and not just opening the app for another reason? Notifications are not designed to do what you want.
See iOS Push Notification - How to get the notification data when you click on the app icon instead of notification for more discussion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With