1 | | iOS 10 is coming with new features such as !CallKit, framework changes such as in !AVFoundation, and also API deprecations. This ticket will review and apply any integrations needed in PJSIP library. |
| 1 | iOS 10 is coming with new features such as !CallKit, framework changes such as in AVFoundation, and also API deprecations. This ticket will review and apply any integrations needed in PJSIP library. |
| 2 | |
| 3 | == !PushKit guide== |
| 4 | |
| 5 | What your application needs to do: |
| 6 | 1. Set up !PushKit according to [https://developer.apple.com/library/content/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html Apple's doc]. |
| 7 | 2. Upon startup, request for push tokens. |
| 8 | 3. Send REGISTER to SIP server with additional specific header or header params to tell the SIP server about the PN (Push Notification) info (server URI, tokens, etc). You can use {{{pjsua_acc_config.reg_hdr_list}}} or {{{pjsua_acc_config.reg_contact_params}}} (the later is available in ticket #1965).[[br]]Note: draft [https://tools.ietf.org/html/draft-ivanov-sipcore-pnsip-01 Push Notifications in the Session Initiation Protocol (SIP)] suggests to put it in Contact header params, for example: |
| 9 | {{{ |
| 10 | Contact: <sip:alice@alicemobile.example.com; |
| 11 | pn-type=acme;pn-methods="INVITE"; |
| 12 | pn-uri="https://pn.acme.example.com/ZTY4ZDJlMzODE1NmUgKi0K"> |
| 13 | }}} |
| 14 | 4. After a successful registration, SIP client can go background and will be woken up by the OS upon receiving push notification. |
| 15 | |
| 16 | Configure your SIP server: |
| 17 | 1. Parse the PN info in registration. |
| 18 | 2. Upon receiving an incoming SIP INVITE, SIP server should contact PN server as specified via PN URI and tokens. |
| 19 | 3. After some interval (assuming the SIP client has been woken up), it then can send/forward the SIP INVITE message to the SIP client. |
| 20 | |
| 21 | == !CallKit support == |
| 22 | a. AVAudioSession handling[[br]] Application needs to handle its own audio session management according to [https://developer.apple.com/reference/callkit?language=objc Apple's doc]. |
| 23 | |
| 24 | {{{#!comment |
| 25 | b. !AudioUnit restart |
| 26 | }}} |
| 27 | |
| 28 | == API/Symbol Deprecations == |
| 29 | a. "{{{kCFStreamNetworkServiceTypeVoIP}}} is deprecated (first deprecated in iOS 9.0 - use !PushKit for VoIP control purposes."[[br]] See the !PushKit guide above.[[br]] If you want to disable the use of {{{kCFStreamNetworkServiceTypeVoIP}}}, set {{{PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT}}} to 0. |
| 30 | |
| 31 | b. AVFoundation API deprecation:[[br]] "warning: 'devices' is deprecated: first deprecated in iOS 10.0 - Use AVCaptureDeviceDiscoverySession instead."[[br]] Done in r5454. |