我已在苹果开发者面板中设置了推送通知并将代码添加到我的应用程序中。
在使用开发配置文件的手机上,它可以正常工作,但如果我使用分发(Ad-hoc)配置文件,以便我可以将其提供给一些用户进行测试,它会出现错误并崩溃,日志显示以下错误。
代码:
在使用开发配置文件的手机上,它可以正常工作,但如果我使用分发(Ad-hoc)配置文件,以便我可以将其提供给一些用户进行测试,它会出现错误并崩溃,日志显示以下错误。
代码:
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 时却会崩溃。
有没有人知道是什么原因导致的?我已经尝试了很多方法来查找问题,但都没有发现任何问题。