217 | | === !PushKit guide, to accept calls in the background after ```kCFStreamNetworkServiceTypeVoIP``` is deprecated (iOS 10/iOS 9) === #bg-call |
218 | | |
219 | | Starting in iOS 9, [https://developer.apple.com/library/ios/documentation/CoreFoundation/Reference/CFSocketStreamRef/index.html#//apple_ref/doc/constant_group/Stream_Service_Types kCFStreamNetworkServiceTypeVoIP] is deprecated. Apple recommends that applications use VoIP Push Notifications (using !PushKit framework) to avoid persistent connections as described in the [https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html Apple's official doc]. This will require application to implement the setup and handling of push notifications in the application layer (for more details, you can refer to ticket #1941). For now, PJSIP will still use ```kCFStreamNetworkServiceTypeVoIP```, if you want to disable it right away, you can set ```PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT``` to 0. |
| 217 | === !PushKit guide, to accept calls in the background after `kCFStreamNetworkServiceTypeVoIP` is deprecated (iOS 16/iOS 10/iOS 9) === #bg-call |
| 218 | |
| 219 | Starting in iOS 9, [https://developer.apple.com/library/ios/documentation/CoreFoundation/Reference/CFSocketStreamRef/index.html#//apple_ref/doc/constant_group/Stream_Service_Types kCFStreamNetworkServiceTypeVoIP] is deprecated. Apple recommends that applications use VoIP Push Notifications (using !PushKit framework) to avoid persistent connections as described in the [https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html Apple's official doc]. This will require application to implement the setup and handling of push notifications in the application layer (for more details, you can refer to ticket #1941). For now, PJSIP will still use `kCFStreamNetworkServiceTypeVoIP`, if you want to disable it right away, you can set `PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT` to 0. |
| 224 | |
| 225 | Starting from iOS 16, using VoIP socket (or `kCFStreamNetworkServiceTypeVoIP`) will cause app getting crashed or killed, under debugger it will show a message like below in the call stack: |
| 226 | {{{ |
| 227 | "Linked against modern SDK, VOIP socket will not wake. Use Local Push Connectivity instead" |
| 228 | }}} |
| 229 | Application using PJSIP 2.12.1 or older can use the following settings in `config_site.h` to avoid that: |
| 230 | 1. Leave `PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT` to `1` (note that by default it is already `1`), this is for maintaining UDP-replacing-socket feature which is still required. |
| 231 | 2. Set `PJ_ACTIVESOCK_TCP_IPHONE_OS_BG` to `0`, or alternatively call `pj_activesock_enable_iphone_os_bg(PJ_FALSE)` before creating any SIP transport or any PJSIP socket in general, this is for disabling the VOIP socket. |