GithubHelp home page GithubHelp logo

allensarmiento / opentok-react-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opentok/opentok-react-native

0.0 1.0 0.0 976 KB

OpenTok React Native - a library for OpenTok iOS and Android SDKs

Home Page: https://tokbox.com/

License: MIT License

Java 39.16% Objective-C 10.64% Swift 27.76% JavaScript 22.05% Ruby 0.38%

opentok-react-native's Introduction

opentok-react-native

Tokbox is now known as Vonage

Please note that this library is not officially supported by Vonage.

React Native library for OpenTok iOS and Android SDKs

In this repo, you'll find the OpenTok React Native library:

Pre-Requisites:

  1. Install node.js

  2. Install and update Xcode (you will need a Mac)

  1. Install and update Android Studio

Installation:

  1. In your terminal, change into your React Native project's directory

  2. Add the library using npm or yarn.

  • npm install opentok-react-native
  • yarn add opentok-react-native

iOS Installation

Note: Please make sure to have CocoaPods on your computer. If you've installed this package before, you may need to edit your Podfile and project structure because the installation process has changed.

  1. In you terminal, change into the ios directory of your React Native project.

  2. Create a pod file by running: pod init.

For React Native < 0.60, add this to your Podfile:

    target '<YourProjectName>' do

      # Pods for <YourProject>
        pod 'OpenTok', '2.17.0'
    end

  1. Now run, pod install

  2. After installing the OpenTok iOS SDK, change into your root directory of your project.

For React Native < 0.60, now run react-native link opentok-react-native.

  1. Open <YourProjectName>.xcworkspace contents in XCode. This file can be found in the ios folder of your React Native project.

  2. Click File and New File

  3. Add an empty swift file to your project:

    • You can name this file anything i.e: OTInstall.swift. This is done to set some flags in XCode so the Swift code can be used.
  4. Click Create Bridging Header when you're prompted with the following modal: Would you like to configure an Objective-C bridging header?

  5. Ensure you have enabled both camera and microphone usage by adding the following entries to your Info.plist file:

<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microphone is accessed for the first time</string>

If you try to archive the app and it fails, please do the following:

  1. Go to Target
  2. Click on Build Phases
  3. Under the Link Binary With Libraries section, remove the libOpenTokReactNative.a and add it again

Android Installation

  1. In your terminal, change into your project directory.

  2. If you have already run react-native link opentok-react-native for the iOS installation, please skip this step.

    • Run react-native link opentok-react-native
  3. Open your Android project in Android Studio.

  4. Add the following to your project build.gradle file:

        maven {
            url "http://tokbox.bintray.com/maven"
        }
  1. Sync Gradle

  2. Make sure the following in your app's gradle compileSdkVersion, buildToolsVersion, minSdkVersion, and targetSdkVersion are greater than or equal to versions specified in the OpenTok React Native library.

  3. As for the older Android devices, ensure you add camera and audio permissions to your AndroidManifest.xml file:

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-feature android:name="android.hardware.camera" android:required="true" />
    <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
    <uses-feature android:name="android.hardware.microphone" android:required="true" />

Newer versions of Android–API Level 23 (Android 6.0)–have a different permissions model that is already handled by this library.

Samples

To see this library in action, check out the opentok-react-native-samples repo.

Development and Contributing

Interested in contributing? We ❤️ pull requests! See the Contribution guidelines.

Tests

Before running tests, install dependencies first:

npm install

Run the tests locally with the following command:

npm test

If a change is expected in a snapshot, run:

npm test -- -u

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

opentok-react-native's People

Contributors

abilashk avatar akodate avatar allensarmiento avatar artemserga avatar dtaborda avatar evillemez avatar ggoldens avatar haytran1 avatar haytran94 avatar lucashuang0802 avatar mbouxin avatar michaeljolley avatar msach22 avatar necromant1k avatar pedro-cerdera avatar snobear avatar t-mdo avatar tomek29k avatar xxsnakerxx avatar yasithdev avatar ythecombinator avatar

Watchers

 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.