Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You cannot re-extend background tasks like this; your app is likely to be terminated. If this is working, it's because you have the background <code>voip</code> mode enabled, not because you are restarting the background task.</p> <p>Once you have set the <code>voip</code> plist entry, iOS will attempt to keep your app alive as long as possible and restart it if it does get terminated. From <a href="https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW3" rel="nofollow">Implementing a VoIP App</a>:</p> <blockquote> <p>Including the voip value in the UIBackgroundModes key lets the system know that it should allow the app to run in the background as needed to manage its network sockets. An app with this key is also relaunched in the background immediately after system boot to ensure that the VoIP services are always available.</p> </blockquote> <p>In addition to setting this key, if you need to periodically run code to keep your voip connection alive, you can use the <a href="https://developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/setKeepAliveTimeout%3ahandler%3a" rel="nofollow">setKeepAliveTimeout:handler:</a> method on <code>UIApplication</code>.</p> <p>See also <a href="https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW12" rel="nofollow">Tips for Developing a VoIP App</a>:</p> <blockquote> <p>There are several requirements for implementing a VoIP app:</p> <ol> <li><p>Add the UIBackgroundModes key to your app’s Info.plist file. Set the value of this key to an array that includes the voip string.</p></li> <li><p>Configure one of the app’s sockets for VoIP usage.</p></li> <li><p>Before moving to the background, call the setKeepAliveTimeout:handler: method to install a handler to be executed periodically. Your app can use this handler to maintain its service connection.</p></li> <li><p>Configure your audio session to handle transitions to and from active use.</p></li> <li><p>To ensure a better user experience on iPhone, use the Core Telephony framework to adjust your behavior in relation to cell-based phone calls; see Core Telephony Framework Reference.</p></li> <li><p>To ensure good performance for your VoIP app, use the System Configuration framework to detect network changes and allow your app to sleep as much as possible.</p></li> </ol> </blockquote> <p>Almost all of the documentation you need is on the Apple developer site.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload