简体   繁体   English

voip app ios8:pushkit还是最佳实践吗?

[英]voip app ios8: is pushkit still best practice?

I am working on an app that needs reliable push messages (like any voip) under ios9. 我正在开发一个需要ios9下的可靠推送消息(如任何voip)的应用程序。 Here it says, that with IOS8+ one should use apns (registerForRemoteNotifications): 在这里它说,使用IOS8 +应该使用apns(registerForRemoteNotifications):

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/occ/instm/UIApplication/setKeepAliveTimeout:handler : 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: 在Optimize VOIP Apps文档中,首选Pushkit:

https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html#//apple_ref/doc/uid/TP40015243-CH30-SW1 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 : VoIP推送通知文档

  • The device is woken only when VoIP pushes occur, saving energy. 只有在VoIP推送发生时才会唤醒设备,从而节省能源。
  • 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会直接推送到您的应用程序进行处理。
  • VoIP pushes are considered high-priority notifications and are delivered without delay. VoIP推送被认为是高优先级通知,并且无延迟地提供。
  • VoIP pushes can include more data than what is provided with standard push notifications. VoIP推送可以包括比标准推送通知提供的数据更多的数据。
  • Your app is automatically relaunched if it's not running when a VoIP push is received. 如果在收到VoIP推送时它未运行,您的应用程序将自动重新启动。
  • 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. 在我看来,VoIP推送通知的最大优势在于,如果强制关闭,应用程序将重新启动。

In general, if you wan't to use the push notifications for VoIP functionality, eg to notify about an incoming call, use PushKit. 通常,如果您不想使用VoIP功能的推送通知,例如通知有来电,请使用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. 如果您将PushKit用于没有VoIP功能的应用程序,您的应用程序将不会通过审核。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM