
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@vonage/client-sdk-video-react-native
Advanced tools
React Native library for using the Vonage Video API.
This library is now officially supported by Vonage.
Important: This version is a beta build of the Vonage Video React Native SDK with support for the React Native new architecture. Be sure to read the next section ("Beta version notes") for important details on using this beta version.
This Beta version is only supported in the React Native new architecture. It is not supported in apps that use the old architecture.
This beta pre-release version is not intended for use in final production apps.
For Android, register the OpentokReactNativePackage, OTPublisherViewNativePackage, and OTSubscriberViewNativePackage packages in the MainActivity file for your app. See step 6 of the "Android Installation" section below.
For iOS, register the OpentokReactNativePackage, OTPublisherViewNativePackage, and OTSubscriberViewNativePackage packages in the MainActivity file for your app. See step 4 of the "iOS Installation" section below.
The following are known issues in this beta version:
otrnError events are missing.Install node.js
Install and update Xcode (you will need a Mac). (See the React Native iOS installation instructions.)
Install and update Android Studio. (See the React Native Android installation instructions.)
See the system requirements for the Vonage Video Android SDK and Vonage Video iOS SDK. (The Vonage Video React Native SDK has the same requirements for Android and iOS.)
In your terminal, change into your React Native project's directory.
Add the beta versioin of the library using npm or yarn:
npm install @vonage/client-sdk-video-react-native@2.31.0-beta.0yarn add @vonage/client-sdk-video-react-native@2.31.0-beta.0Install the iOS pods:
npx pod-install
For React Native versions prior to 0.60:
Add this to your Podfile:
target '<YourProjectName>' do
# Pods for <YourProject>
pod 'VonageClientSDKVideo', '2.30.1'
end
Run react-native link @vonage/client-sdk-video-react-native.
These steps are not necessary in React Native version 0.60 and later.
Ensure you have enabled both camera and microphone usage by adding the following entries to the 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>
When you create an archive of your app, the privacy manifest settings required by Apple's App store are added automatically with this version of the Vonage Video React Native SDK.
Register the OTPublisherViewNative and OTSubscriberViewNative classes. Do this by modifying the AppDelegate implementation.
thirdPartyFabricComponents() function: #import "OTPublisherViewNativeComponentView.h"
#import "OTSubscriberViewNativeComponentView.h"
@implementation AppDelegate
// ...
- (NSDictionary> *)thirdPartyFabricComponents
{
NSMutableDictionary * dictionary = [super thirdPartyFabricComponents].mutableCopy;
dictionary[@"OTPublisherViewNative"] = [OTPublisherViewNativeComponentView class];
dictionary[@"OTSubscriberViewNative"] = [OTSubscriberViewNativeComponentView class];
return dictionary;
}
@end
RCTAppDelegate.application(_, didFinishLaunchingWithOptions) method use a bridging header to call a method in an Objective-C++ file that calls the [RCTComponentViewFactory registerComponentViewClass:] method, passing in the OTPublisherViewNativeComponentView and OTSubscriberViewNativeComponentView classes.If your app will use the OTPublisher.setVideoTransformers() or OTPublisher.setAudioTransformers() method, you need to include the following in your Podfile:
pod 'VonageClientSDKVideoTransformers'
If you try to archive the app and it fails, please do the following:
Go to Target.
Click Build Phases.
Under the Link Binary With Libraries section, remove libOpenTokReactNative.a and add it again.
In your terminal, change into your project directory.
For React Native versions prior to 0.60:
react-native link @vonage/client-sdk-video-react-nativeThis step is not necessary in React Native version 0.60 and later.
Run bundle install.
Make sure the following in your app's gradle compileSdkVersion, buildToolsVersion, minSdkVersion, and targetSdkVersion are greater than or equal to versions specified in the Vonage Video React library.
The SDK automatically adds Android permissions it requires. You do not need to add these to your app manifest. However, certain permissions require you to prompt the user. See the full list of required permissions in the Vonage Video API Android SDK documentation.
In the MainActivity.kt file for you app, register the OpentokReactNativePackage, OTPublisherViewNativePackage, and OTSubscriberViewNativePackage packages. Do this by modifying the MainApplication file by adding these to the list of packages returned by the getPackages() function
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
add(OTPublisherViewNativePackage())
add(OTSubscriberViewNativePackage())
add(OpentokReactNativePackage())
}
// ...
If your app will use the OTPublisher.setVideoTransformers() or OTPublisher.setAudioTransformers() method, you need to include the following in your app/build.gradle file:
implementation "com.vonage:client-sdk-video-transformers:2.30.1"
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' }
}
}
See the docs.
To see this library in action, check out the vonage-video-react-native-sdk-samples repo.
Interested in contributing? We :heart: pull requests! See the Contribution guidelines.
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:
FAQs
Vonage Video client SDK for React Native
The npm package @vonage/client-sdk-video-react-native receives a total of 244 weekly downloads. As such, @vonage/client-sdk-video-react-native popularity was classified as not popular.
We found that @vonage/client-sdk-video-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 45 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.