gpt4 book ai didi

ios - PushKit PKPushRegistryDelegate 没有得到回调

转载 作者:搜寻专家 更新时间:2023-11-01 07:18:03 25 4
gpt4 key购买 nike

将我的应用程序升级到 Xcode8/Swift 3 后,我不再收到来自 PKPushRegistryDelegate 的回调。

我已经验证了 Apple´s Voice Over IP (VoIP) Best Practices 中的所有步骤.

我的设备记录了以下可能相关的信息:

callservicesd[92] : [WARN] Ignoring voipRegister request because either no bundleIdentifier could be determined (0) or no environment could be determined (1)

我的 AppDelegate:

var voipRegistry: PKPushRegistry!

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
voipRegistry = PKPushRegistry(queue: DispatchQueue.main)
voipRegistry.delegate = self
voipRegistry.desiredPushTypes = Set([.voIP])
}

extension AppDelegate: PKPushRegistryDelegate {
func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenForType type: PKPushType) {
print("didInvalidatePushTokenForType")
}

func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, forType type: PKPushType) {
print("Incoming voip notfication: \(payload.dictionaryPayload)")
}

func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, forType type: PKPushType) {
print("voip token: \(credentials.token)")
}
}

最佳答案

我想我必须在目标的功能下启用“推送通知”:

enter image description here

关于ios - PushKit PKPushRegistryDelegate 没有得到回调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40829550/

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