【发布时间】:2009-06-26 10:02:57
【问题描述】:
我已在苹果开发者面板中设置推送通知并将代码添加到我的应用程序中。
使用开发配置文件在手机上运行良好,但如果我使用分发(临时)配置文件以便将其提供给少数用户进行测试,则会出现错误并崩溃,日志会显示以下错误
代码:
Thu Jun 25 22:22:35 unknown SpringBoard[729] <Warning>: *** Assertion failure in -[SBRemoteNotificationServer registerApplication:forEnvironment:withTypes:], /SourceCache/SpringBoard/SpringBoard-919.5/SBRemoteNotificationServer.m:633
Thu Jun 25 22:22:35 unknown SpringBoard[729] <Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no connection found for environment production'
我在应用程序中使用以下代码
代码:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];
我不明白为什么它使用开发配置文件可以完美运行,但使用 ad-hoc 它会崩溃。
有谁知道这是什么原因造成的吗?我已经尝试更改很多东西以尝试找到问题,但一无所获。
【问题讨论】:
-
看看下面“sint”的“Le Monde.fr”建议——它有效!我认为这是一个错误,因此我已将其作为错误 ID #7365308 向 Apple 提出(“使用 APNS 将应用程序从开发人员更改为 Ad Hoc 版本会导致崩溃”)。
-
仅供参考,Apple 对我的错误报告做出了非常迅速的回应,并说:“您能否验证此问题是否也发生在 iPhone 3.1.2 GM. (7D11) 中”。我不太可能在一段时间内对此进行测试。
标签: iphone push-notification adhoc