通知未在IOS设备中显示

时间:2013-07-31 15:11:36

标签: iphone ios apple-push-notifications

我面临通知问题。从过去12小时开始,设备中未显示通知。它早先工作了。发送到其他设备工作正常。 我检查了通知中心和其他东西。已启用应用通知。

以下 http://developer.apple.com/library/ios/#technotes/tn2265/_index.html 我在iOS上启用了启用推送状态消息。

在控制台上,设备正在打印一些信息,如:

<Error>: kDataAttachStatusNotification sent, wasAttached: 1 isAttached: 1

这是什么意思?它是从服务器端收到通知而由于某种原因未能显示和接收的吗?

编辑: 与itunes同步日志后。日志说的是:

2013-08-01 10:51:06 +0530 apsd[76]: _getClientIdentity: already had identity: <SecIdentityRef: (some value here)>
wasUp NO isUp NO linkQualityBelowAndWOWAvail: YES wantsInterfaceAssertion YES  avoidWWANOnCall NO
2013-08-01 10:51:06 +0530 apsd[76]: _getClientIdentity: already had identity: <SecIdentityRef: (some value here)>
2013-08-01 10:51:06 +0530 apsd[76]: peer(68) received XPC_ERROR_CONNECTION_INVALID

1 个答案:

答案 0 :(得分:0)

您是否已请求用户授权提交通知?

尝试将以下代码添加到AppDelegate的application: didFinishLaunchingWithOptions:方法中:

夫特:

 if (UIApplication.instancesRespondToSelector(Selector("registerUserNotificationSettings:"))) {
    application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: .Alert, categories: nil))
 }

目标-C:

if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
    [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert categories:nil]];
}