From version < 44.4 >
edited by Simon Morlat
on 2020/06/23 14:23
To version < 44.5 >
edited by Simon Morlat
on 2020/06/23 14:25
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -100,7 +100,39 @@
100 100  
101 101  = Guidelines for integrating with push notifications =
102 102  
103 += CallKit Integration =
103 103  
105 +Starting from linphone-sdk >= 4.3, **Callkit** must be integrated in the following way:
106 +
107 +* Add the **CallKit** framework into your application's dependencies in Xcode.
108 +* Implement the **CXProviderDelegate** protocol within your **ApplicationDelegate**
109 +* Add the configuration **"use_callkit=1"** in the section **"app" **or call **linphone_core_enable_callkit** before the linphone core starts.
110 +* Since iOS 13, Apple requests **CallKit **to be invoked to display the incoming call immediately when a **PushKit** notification is received. So sometimes you can answer the **CallKit** before a **LinphoneCall** is received. In the callback **CXAnswerCallAction**, if a **LinphoneCall** has not yet been received, you need to configure your **AVAudioSession** and accept the call when you receive it. Otherwise, accept the call directly.
111 +
112 +{{code language="swift"}}
113 +func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
114 + if (call == nil || call.state != Call.State.IncomingReceived) {
115 + // configure audio session here. Use 48000 Hz as sampling rate.
116 + } else {
117 + // accept call here
118 + }
119 + action.fulfill()
120 +}
121 +{{/code}}
122 +
123 +* **CallKit** MUST inform the **LinphoneCore** when **AVAudioSession** is activated, as follows:
124 +
125 +{{code language="swift"}}
126 +func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) {
127 + lc.activateAudioSession(actived: true)
128 + }
129 +
130 +func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) {
131 + lc.activateAudioSession(actived: false)
132 + }
133 +{{/code}}
134 +
135 +
104 104  = Handling liblinphone log =
105 105  
106 106  In order to see liblinphone logs in your IOS app (for example in your Xcode console) follow these steps :