twilio / voice-quickstart-ios

Twilio Voice Quickstart for iOS with Swift
MIT License
183 stars 97 forks source link

[Conference][iOS] How to join the conference automatically instead of showing incoming call notification? #529

Closed anhduy5689h closed 1 year ago

anhduy5689h commented 1 year ago

I'm a conference creator, so I want performAnswerVoiceCall to be called automatically instead of having to receive an incoming call notification. Is there a way to automatically accept the incoming call? With the current sample code, I can only get the callUUID after accepting the incoming call.

bobiechen-twilio commented 1 year ago

Hi @anhduy5689h

Thanks for reaching out. I am trying to understand the use case here - are you trying to join a conference from a mobile client where you already receive an invite from the conference? Regardless of the incoming call being answered or not, the UUID you see from the Call Invite should be exactly same as the callUUID once the call is answered and reported to CallKit.

bennnjamin commented 1 year ago

Apple requires that you report incoming calls to CallKit, which will show an incoming call notification/screen. The CallKit subsystem is going to communicate to your app if the user accepts the call, and only then can you answer it.

If you want an auto-join behavior, you can not use a VoIP push based approach, since all VoIP notifications must be reported to CallKit so that CallKit can handle the accept/rejection of the call.

Instead, you will want to change your approach so the app makes an outgoing call to the conference and this can be triggered by any custom logic. The app will have to be open for this to work. So you can send some other type of push notification (Alert or Silent) or design your UX so that the user must already have opened the app in order to join the conference.

My answer assumes you plan on distributing the app in the App Store and following Apple's guidelines.