I am using CallKit, and it is working fine, it calls on my phone properly, I can answer and deny it.
The problem is there is no 'missed call' notification when I do not answer it.
Is there any setting in CallKit that toggles it?
We were also facing the same issues, and the solution was to manage UILocalNotifications yourself. CallKit only provides triggers and callbacks for events.
Check out the method reportCall(with:endedAt:reason) on CXProvider. You can specify the end reason to let CallKit know why the call ended.
https://developer.apple.com/documentation/callkit/cxprovider/1930701-reportcall
The reasons include:
case failed - An error occurred while attempting to service the call.
case remoteEnded - The remote party explicitly ended the call.
case unanswered - The call never started connecting and was never
explicitly ended, such as when an outgoing or incoming call times
out.
case answeredElsewhere - Another device answered the call.
case declinedElsewhere - Another device declined the call.
If you call reportCall with a reason of unanswered, then it will show up as a missed call in the recent calls section of the phone app.
Related
I'm using Twilio voice quickstart code https://github.com/twilio/voice-quickstart-swift.
When I make a client to client call, call doesn't connect. CallKit runs in the background though, I can see the green notification bar when I send app in the background.
Following is the error:
StartCallAction transaction request failed: The operation couldn’t be completed. (com.apple.CallKit.error.requesttransaction error 7.)
As you can see Googling doesn't help as there doesn't seem to be any solution around?
Does anyone know how to fix or debug it further?
Updated:
Attaching VoIP settings, it's certainly enabled.
Problem is in your code which you write to handle and initialise variables. There is nothing wrong in the Twilio sdk either so don't look there. Anything which you are doing beyond twilio sample code is the place to look for the problem.
I've also wasted months of my time on similar issue and found out that there was issue with initialising one variable.
You are trying to request CXStartCallAction right after another CXStartCallAction was requested. You need to end the first call correctly.
In any case you must follow correct sequence of actions. Once you user wrong action in a sequence, CallKit will return one or another error.
And DO NOT request one action immediately after another is processed. There should be some time between two requests. For example, you initiated CXStartCallAction, then you checked that user is offline and trying to end the call. If that check is quick, then "end action" may result in error. You need to wait a few milliseconds before cancelling the outgoing call.
Twilio developer evangelist here.
Have you enabled capabilities for Voice over IP in the project settings?
Try to initialize CXProvider and CXCallController sooner, before requesting CXStartCallAction
I had the same problem because the Provider and the CallController have been lazy loaded.
It looks like that the CXProvider initWithConfiguration runs asynchronously which means you need to call this early otherwise you run into the risk of having a call without the completion of the initWithConfiguration function.
Thanks to #Allen for pointing me in the right direction.
Sinch - callDidEstablish is not getting called on Lock screen while answering call from CallKit.
I have integrated CallKit but answering call from Lock screen sinch call delegate method is not getting called to establish call.
I also went through iOS Sinch Document it says :-
Invoking -[SINCall answer] while being in the background is possible. The call is not immediately answered but the operation is considered pending and the call answered once the app returns to the foreground.
Is there any way to establish call on answering it from Lock screen.
Thanks in Advance.
Currently our SDK doesnt work with Callkit, we are working on it and will have a release soon (sorry no date yet)
You have to implement CXProviderDelegate to receive callKit actions delegate,
Implement this method from CXProviderDelegate.
-(void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession {
[_client.callClient provider:provider didActivateAudioSession:audioSession];
}
and your callDidEstablish will start getting called.
This is now possible with latest Sinch SDK.
You can find it at Sinch downloads.
They have also given demo Example with SDK.
SINCallKitProvider is class responsible for callKit.Which you can copy from sample example.
Also they have added new Delegate method for it , you can use it as below:
-(void)client:(id<SINCallClient>)client willReceiveIncomingCall:(id<SINCall>)call{
[_callKitProvider reportNewIncomingCall:call];
}
Hope that will help you.
When setting up a WCSession in a watchOS app, does the WCSessionDelegate's sessionReachabilityDidChange: method always get invoked immediately after calling activateSession? From my testing this seems to be true but I am not finding any confirmation of this in documentation.
I ask because if I can rely on sessionReachabilityDidChange: being called immediately after activating the session, I can remove some redundant code from applicationDidBecomeActive that checks for a reachable session and sends some initial messages to the iPhone app.
Why not just call it yourself after you are done doing all your set up? That way you don't rely on any undocumented behavior, yet you don't have to duplicate code in two places
don't know if it's possible, but I have an app that prompts for a number to call. Then the "phone app" is called and the call goes on as usual
After the call ends I would like to trigger an event that makes the user "rate" the call made, always inside this app. I don't need to store any info from the call just done, since the call was already triggered from my app, so I already have the number
Is there a way to trigger those kind of events in iOS?
You need to use CTCallCenter and add a callEventHandler to be notified about state changes to the call.
The app I'm working on makes calls when the user tells it to, using telprompt to come back to the app when the call is over. Is there any way to tell what caused the call to end? If the call failed, I'd like to do one thing, but if it succeeded and the user just hit "END" I want to do something else. I'm not seeing anything in the documentation about it, though.
TIA
Janene