当推送通知到达时,
如果您的应用程序在后台, -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 将被调用。
如果您的应用程序已终止, - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 将被调用以在后台启动您的应用程序。
您可以相应地开始您的问题下载。
注意:确保您已正确设置报亭必备项。
您的“info.plist”还具有以下键
UINewsstandApp UIBackgroundModes 报刊亭内容
您的 didFinishLaunchingWithOptions: 方法中有以下代码
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NKDontThrottleNewsstandContentNotifications"];
这将确保每次 iOS 仅在开发模式下收到 content-available:1 通知时,应用程序都会收到该通知。通常,当应用在 App Store 中时,每个应用(报亭应用)每天只允许一个这样的通知。