Code Monkey home page Code Monkey logo

phonegap-plugin's Introduction

PhoneGap Plugin for OpenTok iOS

Weave video chat into your web (and now mobile!) application.

Step 1. Install and create a PhoneGap app

Make sure You have PhoneGap 2.9 Installed If you haven't, check out PhoneGap's Getting Started Page.

  1. Create a PhoneGap app by going to your PhoneGap's Bin folder, and type into Terminal:
    ./create <project_folder_path> <bundle_id> <project_name>
    Example:
    ./create ~/Development/OpenTokApp me.songz.OpenTokApp OpenTokApp

  2. In the project directory that you just created, and launch *.xcodeproj file.

Step 2. Add the OpenTok iOS SDK to your project

The easiest way is to do this: take a working OpenTok app and copy the OpenTok Framework and all the dependencies to your project. Here's how to do that.

  1. Clone from https://github.com/opentok/OpenTok-iOS-Hello-World.git and open the Hello-World xcode project.
    Be sure to git clone with --recursive to grab the required OpenTok iOS SDK submodule!
    git clone --recursive https://github.com/opentok/OpenTok-iOS-Hello-World.git

  2. In XCode, drag the OpenTok.framework and all the frameworks that OpenTok needs to run that are not currently in your project.
    Make sure Copy items into destination group's folder is not selected
    framework

  3. Drag opentok.bundle file from Hello-World project into the Resources folder for your project bundle

Note When testing, please run your app in your device, and NOT the simulator. The OpenTok iOS SDK requires access to the camera, which is not available in the simulator.

Step 3. Install the OpenTok PhoneGap Plugin

  1. Clone from https://github.com/opentok/PhoneGap-Plugin. git clone https://github.com/opentok/PhoneGap-Plugin

  2. Copy OpenTokPlugin.h and OpenTokPlugin.m from the src folder into your Project's Plugins folder
    Make sure Copy items into destination group's folder is selected.
    ios

  3. Copy OpenTok.js from src folder into your Project's www/js folder.
    js

  4. In the XCode project manager, select config.xml.
    Under widget, add a new feature entry for our plugin

<feature name="TokBox">
  <param name="ios-package" value="OpenTokPlugin"/>
</feature>

Getting Started on your Project:

All your editing will be done in your www folder.

To use the opentok library, make sure you include OpenTok.js file in your HTML document.
<script type="text/javascript" charset="utf-8" src="OpenTok.js"></script>

All JavaScript code should be written in deviceready function in /js/index.js folder because it is executed after all dependencies has loaded.

deviceready: function() {
    // Do Your Stuff Here!
    app.report('deviceready');
},

When you are Deploying into your device:

  1. Make sure your set the Target in the Scheme drop-down menu on the toolbar to your project name
  2. Make sure your device is selected for deployment
    deploy

Tutorial and sample code

Go through the OpenTok API demo to learn the basics!

Next, look at the included in the sampleCode folder and follow the instructions in the README.

Have Fun!



License

Copyright (c) 2012 TokBox, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The software complies with Terms of Service for the OpenTok platform described in http://www.tokbox.com/termsofservice.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

phonegap-plugin's People

Contributors

songz avatar jeffswartz avatar wobbals avatar

Watchers

Theodore Harvey 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.