Search code examples
iosswiftvoipcallkit

How are the CXStartCallAction isVideo property, and native video button used in CallKit?


I'm trying to figure out what happens when the user taps the video button in the native iOS call screen. I've gone through a few tutorials and looked at the code and it doesn't appear to be a delegate method or anything.

CXStartCallAction has a property: var isVideo: Bool, but I cannot seem to figure out how it is used.

I've noticed that (in the Speakerbox example project) it changes the display from "Speakerbox Video" to "Speakerbox Audio", but I'm assuming it has other uses.

The bigger question may be "what does the video button do?" Seems like it just opens the open, but not sure.


Solution

  • I'm trying to figure out what happens when the user taps the video button in the native iOS call screen. I've gone through a few tutorials and looked at the code and it doesn't appear to be a delegate method or anything.

    If you are talking about the "video" button on the screen when you receive an incoming CallKit call when the phone is locked, it apparently sends a new INStartVideoCallIntent intent to your application(_:continue:restorationHandler:) delegate method, just like if the user tapped a previous video call from your app in the Phone app's Recents, or if the user selected to make a video call to a contact in the Contacts app. It will also try to get the user to unlock the phone and then it will open your app.

    CXStartCallAction has a property: var isVideo: Bool, but I cannot seem to figure out how it is used.

    CXStartCallAction is used for making outgoing calls. Whether a CallKit call is marked as video or audio is recorded in the Phone app's Recents and if you tap on a row in Recents it will make the same kind of call to the same person. Making a certain type of call may also make your app show as the default option for making that type of call on the contact's page in the Contacts app, though I'm not exactly sure how that works. Video calls also don't get ended when you lock the phone, but audio calls do.