Giter Site home page Giter Site logo

gsapoz / phonekit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jconst/phonekit

0.0 1.0 0.0 62.49 MB

An extension of TwilioSDK for easily making/receiving VoIP calls from inside your iOS app!

License: MIT License

Objective-C 98.41% Ruby 0.04% DTrace 0.02% C 1.30% Shell 0.23%

phonekit's Introduction

PhoneKit

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, first clone the repo. Then, change the value of kServerBaseURL at the top of PKTViewController.m to point to auth.php on your server. If you have issues with cocoapods, try running pod install in the Example directory.

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

PhoneKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PhoneKit"

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"];

To see what else you can do using PhoneKit, check out the example project and the class headers. And if you'd like to build your own custom views that are aesthetically consistent with PhoneKit, check out the library that the UI is built on: JCDialPad.

Author

Joseph Constantakis, [email protected]. Feel free to email me or open up a GitHub issue if you have any questions!

License

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

phonekit's People

Contributors

jconst avatar

Watchers

Gary Sapozhnikov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.