我正在开发一个应用程序,使用PushKit/voip推送唤醒应用程序来获取消息。它很适合测试设备(杀死应用程序,可以在voip推送时唤醒),但对一些用户来说,它永远不会唤醒。他们使用的是最新的iOS和app。
我还发现,在用户删除/重新安装应用程序后,它突然起作用了。
而且,似乎大多数无法唤醒的设备都安装了很长时间的应用程序,比如1-2年前,但他们都更新到了最新的应用程序。
我想知道1.这个(很久以前安装的)对app的唤醒有什么影响?2.删除/重新安装如何帮助唤醒。3.在不要求用户重新安装的情况下,我可以做些什么来改进它。
谢谢!
发布于 2018-08-29 22:09:59
在Pushkit PKPushRegistryDelegate中,有可用的didInvalidatePushTokenFor。当较长的pushkit令牌不可用时,此方法将调用。您可以使用API调用通知不向此特定设备发送通知( pushkit令牌)。您可以再次调用您的推送注册方法,即您将收到的最新推送工具包令牌,该令牌可用于进一步的新推送通知。
@method pushRegistry:didInvalidatePushTokenForType:
@abstract This method is invoked if a previously provided push token is no longer valid for use. No action is
necessary to rerequest registration. This feedback can be used to update an app's server to no longer
send push notifications of the specified type to this device.
@param registry
The PKPushRegistry instance responsible for the delegate callback.
@param type
This is a PKPushType constant which is present in [registry desiredPushTypes].
@available(iOS 8.0, *)
optional public func pushRegistry(_ registry: PKPushRegistry, didInvalidatePushTokenFor type: PKPushType)请参阅有关https://github.com/hasyapanchasara/PushKit_SilentPushNotification的更多详细信息
https://stackoverflow.com/questions/51038698
复制相似问题