I am currently working on the iOS application with VoIP features. I use CallKit to receive calls. When the device is locked and user accepts a call, the system UI appears and user can tap my application icon to move further to my app. That is an expected behavior and it works fine.
However, I have noticed that when you make a video call with Viber, the behavior is slightly different. When you accept a call, the system UI appears for a brief moment and then the Viber application appears automatically. That is not the case with Telegram, you still have to tap Telegram icon to move further. So the Viber behavior is not expected. Looks like guys from Viber somehow bypass the system UI and jump to their application directly.
Does anybody know how they did it?
So apparently, if you set hasVideo
property to true
for your CXCallUpdate
when reporting the call, system will automatically open your application when call is accepted. Anyway, this feature is not mentioned anywhere in the documentation. Or, at least, I can not find anything about it.
Here is the part of my code that reports new call now:
let update = CXCallUpdate()
update.remoteHandle = CXHandle(type: .generic, value: handle)
update.hasVideo = true // <- was false earlier, setting to true did the trick
update.supportsDTMF = false
update.supportsHolding = true
update.supportsGrouping = false
update.supportsUngrouping = false
callProvider.reportNewIncomingCall(with: uuid, update: update, completion { error in
/*...*/
}