CallKit error UnknownCallProvider

We have an app that uses CallKit for outgoing Voip calls. One of our users started experiencing an issue, where he sometimes receives an UnknownCallProvider error from CallKit 10 seconds after the transaction request. This happens both after the app stays open for a while, and on fresh launches. A device restart didn't help as well. He is not on any other call during that time.

It seems to happen only to him, and only sometimes.

Any estimation what could be the cause? Or how to find out? What are the possible reasons that produce this error?

@ozzzz Thank you so much for this great and interesting question.

A 10-second delay before an error I believe means the system accepted your transaction request, attempted to communicate with your app to execute the action, but gave up after 10 seconds because it couldn't reach the provider or didn't get a response?

If your CXProviderDelegate is set to receive callbacks on the main queue , and that queue is blocked for more than 10 seconds, the system will time out. I actually have more questions than answers, user taps "Call", you request the transaction, and then your app immediately does heavy synchronous work on the same thread CallKit is trying to use to call provider(_:perform:)? That’s the main thread, you should add an asynchronous call for that, otherwise after 10 seconds of waiting for your app's queue to free up terminates the request and throws the UnknownCallProvider error? Is that what are you seeing?

Is the app immediately suspended by the OS before the CallKit transaction can be fully processed? The user initiates a call and immediately swipes up to go to the home screen, or the device locks?

Since the issue is reproducible for this user, ask them to trigger a sysdiagnose right after the error happens. Open the logs in the Console app and filter for callservicesd. You will likely see explicit logs stating exactly why it dropped the transaction.

Albert
  Worldwide Developer Relations.

CallKit error UnknownCallProvider
 
 
Q