gpt4 book ai didi

iphone - 通知未在 IOS 设备之一中显示

转载 作者:可可西里 更新时间:2023-11-01 04:02:39 24 4
gpt4 key购买 nike

我遇到了通知问题。过去 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

最佳答案

您是否已请求用户允许显示通知?

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

swift :

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

objective-C :

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

关于iphone - 通知未在 IOS 设备之一中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17974200/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com