Callkit present Application UI instead of native UI - ios

I want to use Callkit framework to present iOS native UI in incoming call for my voip app when smartphone is locked (more efficient than a simple notification), but after answering I would like to go to my app UI instead of one provided by callkit.
Preferentially I would like go immediately after answering the call, 2nd option would be a option in callkit UI to move to my app.
Any idea if that is possible? Didn't figure out any solution till now.
Thank you
Jose

CallKit provides the calling interface
https://developer.apple.com/documentation/callkit
Unfortunately there is no way to control calling interface for an incoming call.
When the device is locked, user will see native call UI after answering the call. If they wish to move to your app, they will have to tap corresponding button ("Messenger" button on the screenshot below):
When the device is unlocked, however, user will be redirected straight to your app automatically once they accept the call, so there is that.

Related

How to implement callkit with connectycube on cordova ios application

Dear Connectycube Team,
I hope this email finds you well.
Our company has integrated Connectycube into our application, which primarily relies on video calling for communication between users and service providers. To ensure a seamless user experience, it's imperative that the video calling system is robust and reliable.
Unfortunately, our development team is facing challenges in making the system highly robust and 100% reliable. The issue lies in the connection dropping when the application is killed or the phone is locked.
issue: We are trying to integrate connecticube onto cordova app. We are using callkit to implement native incoming screen. The issue is that whenever the app is killed or the phone's screen is locked, accepting the call on callkit leads to failure since the accept call function gets called before the connecticube oncall event listener is called.
I would like to request a call with your technical team to discuss this matter and receive any insights or recommendations that could improve the video calling system.
Thank you for your assistance.
Best regards,
Kanhu
Once we receive incoming call using callkit and the user accepts the call, we try to send the accept call command to connectycube. But since the oncall event is not fired immediately, we create a callback loop to wait for the oncall event to get fired. This works sometimes but fails most of the time. Is there any other way ro achieve the accept call functionalities using callkit and connectycube on cordova.

CallKit UI for Outgoing Calls

I'm building a React Native VoIP app that uses react-native-callkeep to integrate the native call handling UI. For iOS it uses CallKit, and in the case of inbound calls when the app is running in the background or the screen is locked, the native UI pops up as expected and the user can interact with that UI to control the call.
However, in the case of outgoing calls the native UI never shows up. A bit of searching shows contradicting information regarding intended behavior here. The following state that this is expected behavior, and that your app needs to build the UI for outgoing calls:
CallKit - How to bring the CXCallController to the front
https://github.com/react-native-webrtc/react-native-callkit/issues/13
While these CallKit examples show outbound calls using the system UI:
https://agostini.tech/2019/06/16/intro-to-callkit/
https://medium.com/swlh/the-absolute-basics-of-ios-callkit-send-receive-a-call-1c2700e13f14
https://www.slideshare.net/GuillaumeBerthier2/manage-your-calls-with-callkit
Am I misunderstanding something fundamental here, or is there possibly an issue related to react-native?
If the user starts an outgoing call from within the native application and then locks the device they will see the native user interface. If the device is not locked; the user will not see the native user interface and requires you to implement your interface for handling actions. There is no way to utilize the native user interface while your application is in the foreground.

How do you open the in Call UI after answering a call with callkit

I am trying to integrate callkit with my voip app. At this point the CallKit displays an incoming call but as soon as I press the answer key it just goes back to my app's display homescreen. I want the in call UI of CallKit to display when I press the answer key.
func provider( _ provider: CXProvider, perform action: CXAnswerCallAction) {
XCPjsua.shared()?.handleIncomingCall();
// confifureAudioSession()
action.fulfill()
}
In the XCPjsua.shared()?.handleIncomingCall(); function I just connect the call.
CallKit provides better integration to the system and better VoIP app visibility, but they limit the use of their call screens. You must provide call UI yourself.
The main purpose of using CallKit in your VoIP app is to improve its usability when app is killed and phone is locked. By using CallKit, system elevates the shared audio session of your VoIP app as the top priority, in order to improve the user experience. CallKit is also responsible to improve your integration to the system services, like handsfree bluetooth integration, car play, Siri, etc.
As soon as you answer, the CallKit UI is displayed only if the phone is locked. If the phone is unlocked you will be redirected to your app, so is your responsibility to implement an ongoing call UI.
It seems that the in-call screen is in the app carousel of background apps and can be switched to manually

How to close Callkit UI when call is not connected

I'm using Twilio Programmable Voice SDK. I'm facing an issue where call doesn't connect but CallKit UI starts. When I send app into background I can see the CAllKit UI running with green notification bar at the top.
There seems to be some issue with Twilio which twilio support hasn't been able to figure out and can't provide a solution.
As a workaround I want to close CallKit UI after a time interval when call doesn't connect.
I know how to kill CallKit UI when a call is connected but this doesn't apply in my case as call isn't connected at all.
My question is how do I kill CallKit UI when call isn't connected?
My issue is exactly similar to what is reported here How to close call kit when call doesn't connect but call kit ui is running in the background
Please read it again.
Call is not connected but CallKit UI is started and I want to close it. Note that when a call is not connected you will not get uuid hence you can't call disconnect.
Looking at the ViewController code, it seems like the UUID should be stored in one of this two members:
var callInvite: TVOCallInvite?
var call: TVOCall?
In the case of an incoming call that has not been already answered the UUID is contained in callInvite, otherwise (i.e. outgoing call or answered incoming call) in the call object.

How to intercept and parse incoming calls via an app

How does Truecaller intercept incoming phonecalls on the iphone to display caller ID?
I didn't think this was possible from within the app?
Specifically, if I wanted to build this functionality, what protocols would I go about using?
http://www.truecaller.com/how-it-works
On an iPhone, without jailbreaking it:
- you cannot intercept a call in any way
- you cannot determine the phone number nor the caller ID identifying information regarding the call. Even if you could there
is no way to alter what is displayed on the call screen
- you cannot block the call
- your program can get a notification when a call is being made/terminated etc. But only if your app is executing in the
foreground at the time of the call or if the app is in the
background and has a relevant background mode (even then you can
only know there is a call in some circumstance, depending upon what
you're doing in the background and what state your in etc. Its too complex to describe the exact situation here briefly)
True Caller doesn't do that on iOS as it isn't supported with the native SDK. See their FAQ:
http://www.truecaller.com/support , specifically the "Why don't I receive live caller ID?" Section under "iPhone/Windows Phone". If you must though, try looking into a solution for jailbroken devices.
It's impossible to "intercept" calls. It is possible to handle the "background event call" when a iPhone get's a call. That said, Truecaller doesn't intercept calls. More info can be found on their website.

Resources