I'm trying to read push message when app is in background or killed and user tap on application icon(which has badge) instead from notification center.I have seen few questions in stackoverflow regarding this, but non of them solve this problem,
Here is the scenario,
- I receive a push message.
- And then i ignore the message.
- Next i launch the application by tapping icon which has badge(not from the notification center)
- It won't call
didReceiveRemoteNotification:
method.
As per iOS application life cycle, it'll run didFinishLaunchingWithOptions:
when app launches, and next time it'll call applicationWillEnterForeground:
and applicationDidBecomeActive:
methods. my question is how can i read all the push messages from above life cycle methods which i received previously and ignored?
I have already tried below snippet in didFinishLaunchingWithOptions:
(From this answer) but i always get null as payload.
NSDictionary *pushNotificationPayload = [launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if(pushNotificationPayload) {
NSLog(@"Payload is not null");
[self application:application didReceiveRemoteNotification:pushNotificationPayload];
}else{
NSLog(@"Payload is null");
}
Any valuable answer appreciated, Thanks.
BTW, i use iOS 6