ios use VoIP push notification

        In the past, VoIP applications had to maintain a continuous network connection with the server to receive incoming calls and other data. This means writing complex code to send periodic messages back and forth between the application and the server to keep the connection alive, even when the application is not in use. This technique leads to frequent device wakeups with wasted energy. This also means that if the user exits the VoIP application, they will no longer receive calls from the server.

         For now, developers should use the pushkit framework API instead of a persistent connection, which allows applications to receive pushes from remote servers (notifications when data is available). As long as the push is received, the application will be called to operate. For example, a VoIP application can display an alert when a call is received and provide the option to accept or decline the call. If the user decides to accept, it can even begin to take premonitory steps to initiate the call.      

Using pushkit to receive VoIP push has many advantages:

  • Only when VOIP push occurs, the device will be awakened, saving energy.
  • Unlike standard push notifications, where users must respond to the application before performing operations, VoIP pushes go directly to the application for processing.
  • VoIP push is considered a high priority notification and will not delay delivery.
  • VoIP push can contain more data than standard push notification provides.
  • If the application is not running when the VoIP push is received, it will automatically restart.
  • Even if your app is running in the background, your app will handle pushes while it is running.

Note: Pushkit VoIP support is provided in iOS 8 and higher.

For specific content information, please refer to the official document: https://developer.apple.com/library/archive/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html

Guess you like

Origin blog.csdn.net/Swallow_he/article/details/94439667