我通过以下代码在PKPushRegistry
方法AppDelegate
中为func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
注册了委托:
let voipRegistry: PKPushRegistry = PKPushRegistry(queue: nil)
voipRegistry.delegate = self
voipRegistry.desiredPushTypes = [.voIP]
self.voipRegistry = voipRegistry
当我在iOS 12上运行应用程序时,一切正常运行-方法func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType)
已触发,但在iOS 13中,此方法根本未触发。
在iOS 13机箱中我该怎么做?可能需要添加一些其他代码吗?
答案 0 :(得分:0)
我不知道发生了什么变化,但是在一天之后一切正常-收到令牌后,触发了方法func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType)
。