iPhone SDK推送通知 [英] iPhone SDK Push Notification

查看:155
本文介绍了iPhone SDK推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在apple开发人员面板中设置了推送通知,并将代码添加到我的应用程序中。

I have setup push notifications in the apple developer panel and added the code to my application.

使用开发配置文件在手机上工作正常但是如果我使用分发(ad-hoc)配置文件,以便我可以将它提供给一些用户进行测试,它会产生错误并导致崩溃,日志会出现以下错误

It works fine on the phone using a development profile but if I use a distribution (ad-hoc) profile so that I can give it to a few users for testing it gives an error and crashes, the log gives the following error

代码:

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'

我正在使用应用程序中的以下代码

I am using the following code in the app

代码:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];

我不明白的是为什么它使用开发配置文件完美地工作但是ad-hoc它会崩溃。

The thing I don't understand is why it works perfectly using a development profile but with ad-hoc it crashes.

有谁知道会导致这种情况的原因?我尝试过更改很多事情来尝试找到问题但却一无所获。

Does anyone know what would cause this?, I've tried changing lots of things to try and find the issue but have found nothing.

推荐答案

我通过从App Store安装使用推送通知的随机应用程序,在我的一个开发设备上解决了这个问题。在这种情况下,我安装了Le Monde.fr应用程序。在我运行该应用程序一次后,我自己的应用程序不再崩溃。

I solved this problem on one of my development devices by installing a random application from the App Store which uses push notifications. In this case, I installed the Le Monde.fr application. After I ran that application once, my own application no longer crashed.

这篇关于iPhone SDK推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆