Push notification when the application is not running - launchOptions dictionary is empty

I read here a few questions about how to receive push notifications while the application is not running (more than in the background, which means that it is completely disabled). This question in particular is most useful when determining how to determine if it was obtained using the launchOptions dictionary.

However, I am very confused, and I fully admit that this can be a serious oversight on my part: when my device receives a push notification for this application, when the application is closed, and I later open the application, launchOptions is a null pointer. From the description of the accepted answer in the above link and elsewhere, I understand that I should be able to see the notification payload; however there is nothing. I am developing for iOS 5.1.1.

My only thought is to check the number of icons at startup (greater than zero, do something ...), but it seems very unreliable.

Can someone tell me what I am missing? Thank you in advance for your help!

+5
source share
1 answer

application:didFinishLaunchingWithOptions: , - . . , ( ) , content-avialble = 1 ( Newsstand), , .

, . Newsstand ,

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

[[UIApplication sharedApplication] applicationState] UIApplicationStateActive.

, , , didFinishLaunchingWithOptions didReceiveRemoteNotification.

, didReceiveRemoteNotification [[UIApplication sharedApplication] applicationState], UIApplicationStateActive.

notification, , , 1 . ( ) didFinishLaunchingWithOptions . ( , )

, . , iOS SDK >= 4.0

+7

All Articles