We have a iOS app in which we have integrated video calling using WebRTC sdk. Now we would like to use the Call Kit https://developer.apple.com/documentation/callkitin the app to display the call UI. When i am chekcing in docuemntation of the call kit it says that it can be used for voip app. Therefore we would like to know if as per the apple developer guidelines is it allowed to use the call kit features in a app providing voice and video calling using webrtc.
Can we use Callkit for Apps with WebRTC
CallKit integration
Disclaimer: I am not sure if this is the best way doing it but this has worked for me so far:
- Configure WebRTC audio session to use manual audio and disable audio:
RTCAudioSession.sharedInstance().useManualAudio = true
RTCAudioSession.sharedInstance().isAudioEnabled = false
- On your
CXProvider
delegate'sprovider(CXProvider, didActivate: AVAudioSession)
method:- Call
RTCAudioSession.sharedInstance().audioSessionDidActivate
with theAVAudioSession
from theCXProvider
- Enable audio:
RTCAudioSession.sharedInstance().isAudioEnabled = true
- Call
- On your
CXProvider
delegate'sprovider(CXProvider, didDeactivate: AVAudioSession)
callRTCAudioSession.sharedInstance().audioSessionDidDeactivate
with theAVAudioSession
from theCXProvider
WebRTC and CallKit talk from 2016: https://youtu.be/JB2MdcY1MKs?t=6m23s
credit to stasel from WebRTC-iOS