Kodeco Forums

CallKit Tutorial for iOS

Learn how your app can use CallKit for system-level phone integration and how you can build a directory extension for call blocking/identification.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/701-callkit-tutorial-for-ios

How can I make a voip call between two iphones, not dummy. Thank you very much, Jozsef.

Followed description with Xcode 8.3. Getting an error in CallViewController.swift unwindForNewCall in line:
AppDelegate.shared.displayIncomingCall(uuid: UUID(), handle: handle, hasVideo: videoEnabled) { _ in

Compiler telling:
Value of type ‘AppDelegate’ has no member ‘displayIncomingCall’

In AppDelegate.swift in class there is
func displayIncommingCall(uuid: UUID, handle: String, hasVideo: Bool = false, completion: ((NSError?) → Void)?) {
providerDelegate.reportIncomingCall(uuid: uuid, handle: handle, hasVideo: hasVideo, completion: completion)
}

any ideas?

I have installed your code on two iphone and I can’t communicate between them. You can guide me ?. Thanks for sharing.

I see that there’s a typo in the method you pasted. Try this:

func displayIncomingCall(uuid: UUID, handle: String, hasVideo: Bool = false, completion: ((NSError?) -> Void)?) {
    providerDelegate.reportIncomingCall(uuid: uuid, handle: handle, hasVideo: hasVideo, completion: completion)
  }

This tutorial only covers CallKit, not making VoIP calls. There is no VoIP backend in place, so all the calls are dummy operations. You won’t be able to use the sample app to communicate between two phones.

You would need a VoIP server in place, and instead of the dummy operations, your app would have to communicate with this server. That was not in the scope of this tutorial however.

Thanks for your answer Jozsef, understood.

In your article you are using in unwindForNewCall
the expression:

AppDelegate.shared.displayIncomingCall(uuid: UUID(), handle: handle, hasVideo: videoEnabled) { _ in


completion is missing.

So are we saying that I would be able to detect an incoming call, and if it is not in the contacts, I could check another “my own” directory of numbers and if found, display that users name?

About outgoing call, I enter a real number, how make app go to native outgoing call UI and do that call.
I know it just a dummy operation but in recents call in my phone, that number still display there.
Could u pls give a hint or topic to do that.

Hi,
is it possible to use the CallKit to get notified for real cellular phone calls (no VoIP)?

cheers

Hello, I have a question how we can start calls from the native Phone app’s Contacts like Whatsapp app ? thanks

Is it possible to tie-in to an existing call with the CallKit code you provided and use my app? Can I use the functionality of the CallKit code? Or is it just an example? If it is actual, usable code, how do I tie-in to an existing call?

Hey, awesome project! It would be interesting to see this work with WebRTC (or AppRTC as seen on some swift projects on Github). Any chance this happens as one of your future tutorials? :yum:

1 Like

What are the stopAudio() and startAudio() functions supposed to do?

after adding the code for outgoing calls I am getting this error:

“The controller couldn’t find a call provider to perform the actions in the requested transaction.” CXTransactionError code=2

1 Like

i also get the same error when running the completed version of the project

1 Like

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]

1 Like