是否可以知道应用程序是否通过推送通知启动/打开?
我猜这个发布活动可以在这里找到:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if (launchOptions != nil) {
// Launched from push notification
NSDictionary *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
}
}
Run Code Online (Sandbox Code Playgroud)
但是,当应用程序处于后台时,如何检测到它是从推送通知中打开的?
push-notification apple-push-notifications uiapplicationdelegate ios ios6