iOS应用无法接收报刊通知

时间:2012-09-27 08:23:05

标签: ios xcode notifications push newsstand-kit

我是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];

由于应用程序能够处理正常的Push Notifcations(警报,声音等),我认为这完全是关于限制,但是,正如我上面提到的,我设置默认值不使用限制。我已经阅读了一些Apple的指导,并通过许多论坛进行了搜索,发现我需要将我正在使用的设备设置为在XCode组织中“启用开发”。但是我找不到任何复选框或按钮来设置它。我使用XCode 4.5。

任何人都可以帮我解决这个问题吗? 您是否知道如何调试通知并检查它们消失的位置?

1 个答案:

答案 0 :(得分:1)

您必须发送内容可用的推送通知:1,并在设备的应用的报亭设置中将自动下载设置为“开启”。