如果我点击通知警报,则应用程序会启动,我可以看到字典中存在"content-available":1,并且该问题已下载,但应用程序不会自动启动。
我已经添加到plist中:
<key>UIBackgroundModes</key>
<array>
<string>newsstand-content</string>
</array>
并在didFinishLaunchingWithOptions方法中:
[[NSUserDefaults standardUserDefaults]setBool: YES forKey:@"NKDontThrottleNewsstandContentNotifications"]; // for testing purposes
[[NSUserDefaults standardUserDefaults] synchronize];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeNewsstandContentAvailability )];
我发现我的应用程序未显示在“设置” -> “商店” -> “自动下载”下(而其他杂志则出现在那里)。
我有什么遗漏的吗?这在沙盒环境中是否有效?
alert
关键字是必须的,以便将通知添加到托盘。需要一个消息字符串来显示内容!如果答案中提供了苹果文档链接会更好。 - tipycalFlow