PhoneKit 0.2.0

PhoneKit 0.2.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Joseph.



PhoneKit 0.2.0

  • By
  • Joseph Constantakis

PhoneKit is an easy to use extension/wrapper of the Twilio Client iOS SDK for easily making/receiving VoIP calls from inside your iOS app.

Features

  • a simple API for making calls to real phones or other clients
  • a full-featured modal view controller to allow your users to interact with the call
  • options to mute, switch to speakerphone, and send DTMF tones
  • a property to set the caller ID
  • a call record object containing useful information about a past call
  • useful helper methods on NSString for dealing with phone numbers

Server

Twilio Client Server

Unfortunately, the Twilio Client SDK requires all client-side apps to have a custom server-side counterpart that issues your app capability tokens and hosts TwiML to handle the calls. To hopefully make your life easier, I've created the repo above to address the server-side needs of the most common use cases for Twilio Client. It can be easily deployed to your heroku account in about a minute – simply follow the readme on that repo to get the server set up.

Demo

To run the example project, clone the repo, and run pod install from the Example directory first. Then, change the value of kServerBaseURL at the top of PKTViewController.m to point to auth.php on your server.

After starting the app, you can press "Call" immediately to hear a simple demo message. To call a real phone, you must first set the caller ID field to a number you have verified with Twilio. Then simply type the callee's phone number (don't worry about the formatting) into the Callee text field and press Call.

Installation

Usage

After grabbing the token from auth.php, hand it to the Phone:

[PKTPhone sharedPhone].capabilityToken = token;

Set an optional caller ID:

[PKTPhone sharedPhone].callerId = @"1(555)867-5309";

I recommend using the provided PKTCallViewController for your call UI:

self.callViewController = [PKTCallViewController new];
[PKTPhone sharedPhone].delegate = self.callViewController;

Make a call!

[[PKTPhone sharedPhone] call:@"1 555-234-5678"];

Author

Joseph Constantakis, [email protected]

License

PhoneKit is available under the MIT license. See the LICENSE file for more info.