npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

opentok-react-native

v2.27.4

Published

React Native components for OpenTok iOS and Android SDKs

Downloads

19,851

Readme

opentok-react-native

React Native library for using OpenTok.

This library is now officially supported by Vonage.

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 'OTXCFramework', '2.25.5'
    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. Sync Gradle

  5. 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.

  6. 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.

Bintray sunset

Bintray support has ended (official announcement: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/). In your app build.gradle file you need to remove reference to jcenter and replace it with mavenCentral. Example:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ...
    repositories {
        google()
        mavenCentral()
    }
    ...
}

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
        maven { url 'https://www.jitpack.io' }
    }
}

Docs

See the docs.

Samples

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

Development and Contributing

Interested in contributing? We :heart: pull requests! See the Contribution guidelines.

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: