Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to declare my iOS voip app as an option on contact info (like whatsApp)?

I want to add my app in the contact info in the address book for messaging, video calls.

enter image description here

like image 664
Wiss Avatar asked Oct 18 '22 09:10

Wiss


2 Answers

This functionality can be achieve using CallKit, in short CallKit provides native phone app UI to all the VoIP application, to let your app visible in the contact (after integrating the CallKit), you just need to smoothly long press the audio/video call buttons.


By default It shows the most frequent used app (say WhatsApp), once you'll long press the icons it'll show a list of the supporting apps (VoIP enable apps). From where you can choose the app to perform the action.

The screenshots will make you more sense to figure it out.



Image 1 - is the default situation I.e. default call and video option. 


Image 2 - Long press the call option, It’ll show all the apps which are capable to make audio call.


Image 3 - Same for the video option.


Image 4 - Once you’ll use any app (suppose WhatsApp) the default icon will change to WhatsApp and in the list it’ll start showing WhatsApp and other concern apps.

Source: #1 Ray Wenderlich Toutorial , #2 Sample Code of CallKit Objective-C & Swift both



Note: - In the list below it’ll start showing the apps name once you use any app to make call. And it’ll remain listed even if you uninstall that particular app.

like image 64
Mohit G. Avatar answered Oct 20 '22 23:10

Mohit G.


I assume you are using CallKit. So adding .phoneNumber to supportedHandleTypes gives this ability that you can call number via your application.

.generic also gives ability you can start call from history that made or received via your application.

  let config = CXProviderConfiguration(localizedName: "anyname you want")
  config.supportedHandleTypes = [.phoneNumber,.generic]
like image 26
Bilal Şimşek Avatar answered Oct 21 '22 00:10

Bilal Şimşek