gpt4 book ai didi

ios - 网络电话应用 ios8 : is pushkit still best practice?

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

我正在开发一个在 ios9 下需要可靠推送消息(如任何 voip)的应用程序。这里说,对于 IOS8+,应该使用 apns(registerForRemoteNotifications):

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/occ/instm/UIApplication/setKeepAliveTimeout:handler :

在Optimize VOIP Apps 文档中,Pushkit 是首选:

https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html#//apple_ref/doc/uid/TP40015243-CH30-SW1

有人知道吗?或者他们是否在后台运行相同的代码?

最佳答案

来自documentation for VoIP Push Notifications :

  • The device is woken only when VoIP pushes occur, saving energy.
  • Unlike standard push notifications, which the user must respond to before your app can perform an action, VoIP pushes go straight to your app for processing.
  • VoIP pushes are considered high-priority notifications and are delivered without delay.
  • VoIP pushes can include more data than what is provided with standard push notifications.
  • Your app is automatically relaunched if it’s not running when a VoIP push is received.
  • Your app is given runtime to process a push, even if your app is operating in the background.

在我看来,VoIP 推送通知相对于常规推送通知的最大优势在于,如果应用被强行关闭,它会重新启动。

一般来说,如果您不想使用 VoIP 功能的推送通知,例如要通知来电,请使用 PushKit。它是为此目的而开发的。对于所有其他情况,请使用常规推送通知。如果您将 PushKit 用于没有 VoIP 功能的应用,则您的应用将不会通过审核。

关于ios - 网络电话应用 ios8 : is pushkit still best practice?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32760520/

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