简体   繁体   中英

voip app ios8: is pushkit still best practice?

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, eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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