【发布时间】:2012-09-27 08:23:05
【问题描述】:
我是 iOS 编程新手,在开发报亭应用程序时遇到了一个真正的问题。 简单地说,应用程序似乎没有收到报亭通知(我在 didReceiveRemoteNotification 和 didFinishLaunchingWithOptions 中有 NSLog,并且在 XCode 中运行的应用程序期间没有显示日志)。我在 info.plist 中设置了所有需要的设置,我也将它包含在我的应用程序中:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// register for Push notification and don't use throttling for development
//[[UIApplication sharedApplication] unregisterForRemoteNotifications];
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NKDontThrottleNewsstandContentNotifications"];
[[NSUserDefaults standardUserDefaults] synchronize];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability];
由于应用程序能够处理正常的推送通知(警报、声音等),我认为这完全是关于节流的,但正如我上面提到的,我将默认设置为不使用节流。我已经阅读了一些 Apple 的指南并搜索了许多论坛,发现我需要在 XCode 组织中将我正在使用的设备设置为“启用开发”。但是我找不到任何复选框或按钮来设置它。我使用 XCode 4.5。
谁能帮我解决这个问题? 您知道如何调试通知并检查它们消失的位置吗?
【问题讨论】:
-
我刚刚发现,但是我运行
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeNewsstandContentAvailability],enabledRemoteNotificationTypes 仍然是 0。 -
我刚刚解决了。这是关于 iPad 商店设置和启用应用程序的自动下载。
标签: ios xcode notifications push newsstand-kit