voip app ios8:pushkit 仍然是最佳实践吗? [英] voip app ios8: is pushkit still best practice?

查看:28
本文介绍了voip app ios8:pushkit 仍然是最佳实践吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个在 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

有人知道这个吗?还是他们在后台运行相同的代码?

解决方案

来自 VoIP 推送通知文档:

<块引用>
  • 仅在发生 VoIP 推送时才唤醒设备,从而节省能源.
  • 与标准推送通知不同,用户必须先响应您的应用程序可以执行操作,VoIP 推送会直接发送到您的应用程序用于处理.
  • VoIP 推送被视为高优先级通知并立即交付.
  • VoIP 推送可以包含更多数据比标准推送通知提供的内容.
  • 您的应用是如果 VoIP 推送未运行,则自动重新启动收到.
  • 您的应用有运行时间来处理推送,即使您的应用应用正在后台运行.

在我看来,VoIP 推送通知与常规通知相比的最大优势在于,如果应用程序被强制关闭,它会重新启动.

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

I am working on an app that needs reliable push messages (like any voip) under ios9. Here it says, that with IOS8+ one should use apns (registerForRemoteNotifications):

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

In the Optimize VOIP Apps document, Pushkit is preferred:

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

Does anybody have a clue on this? Or do they run the same code in the background?

解决方案

From the 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.

The biggest advantage of VoIP Push Notifications over regular ones is in my opinion, that the app gets relaunched if it was force-closed.

In general, if you wan't to use the push notifications for VoIP functionality, e.g. to notify about an incoming call, use PushKit. It was developed for this purpose. For all other cases, use regular push notifications. Your app won't go through the review if you use PushKit for an app without VoIP functionality anyways.

这篇关于voip app ios8:pushkit 仍然是最佳实践吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆