Run the application from the main screen can not get the remote payload? But starting from the notification center

Launching the application from the main screen cannot receive the remote useful push signal? But starting from the Notification Center works.

At first the application does NOT work . After receiving a remote push notification, the user does not start the notification application immediately. Then the user clicks on the notification in the Notification Center to launch the application, I can get the push payload from launchOptions:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    NSDictionary* userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    if(userInfo) {
        //do some works with push payload.
    }
}

But if the user launches the application by clicking the application icon on the desktop, I can’t get the push payload launchOptions, although it is being called application:didFinishLaunchingWithOptions:.

Yet again:

  • The application does not work.
  • push-.
  • , push launchOptions.
  • push startOptions.

SDK? push, ?

!

+5
2

.

, , .

, Tweetbot, , , , .

, , .

+3

, , , .

, .

0

All Articles