Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
opentok-react-native
Advanced tools
In your terminal, change into your React Native project's directory
In your terminal, run npm install opentok-react-native
Note Please make sure to have CocoaPods on your computer.
In you terminal, change into your ios
directory.
Create a pod file by running: pod init
.
Add the following to your pod file:
platform :ios, '9.0'
target '<YourProjectName>' do
use_frameworks!
# Pods for <YourProject>
pod 'OpenTok'
end
Now run, pod install
Open XCode
Open <YourProjectName>.xcworkspace
file in XCode. This file can be found in the ios
folder of your React Native project.
Click File
and Add Files to
Add the following files from ../node_modules/opentok-react-native/ios
to the project:
OTPublisher.h
OTPublisher.m
OTPublisherManager.swift
OTPublisherView.swift
OTRN.swift
OTSessionManager.m
OTSessionManager.swift
OTSubscriber.h
OTSubscriber.m
OTSubscriberManager.swift
OTSubscriberView.swift
Click Create Bridging Header
when you're prompted with the following modal: Would you like to configure an Objective-C bridging header?
Add the contents from the Bridging-Header.h
file in ../node_modules/opentok-react-native/ios
to <YourProjectName>-Bridging-Header.h
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>
In you terminal, change into your project directory.
Run react-native link opentok-react-native
Open your Android project in Android Studio.
Add the following to your project build.gradle
file:
maven {
url "http://tokbox.bintray.com/maven"
}
Sync Gradle
Make sure the following in your app's gradle compileSdkVersion
, buildToolsVersion
, minSdkVersion
, and targetSdkVersion
are the same in the OpenTok React Native library.
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.
If you make changes to the project that you would like to contribute back then please follow the contributing guidelines. All contributions are greatly appreciated!
FAQs
React Native components for OpenTok iOS and Android SDKs
The npm package opentok-react-native receives a total of 1,963 weekly downloads. As such, opentok-react-native popularity was classified as popular.
We found that opentok-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.