Integrating React Native SDK for Android
React Native links the SDK automatically, so you do not need to edit settings.gradle or MainApplication.
If you are upgrading from v1.0.1, follow the Migration Guide. It lists the react-native-webrtc lines to remove from your Android project.
Step 1: Install the SDK.
The simplest way to get started is by installing the SDK in your application using the provided command:
- NPM
- YARN
npm install "@videosdk.live/react-native-sdk@2.0.0"
yarn add "@videosdk.live/react-native-sdk@2.0.0"
This is the only VideoSDK package you need.
-
If you are using a Windows machine, make sure to include the double-quotes while installation.
-
If you are facing
Error: unable to get local issuer certificate, below is the solution for the same
# for CMD
set NODE_TLS_REJECT_UNAUTHORIZED=0
# for PowerShell
$env:NODE_TLS_REJECT_UNAUTHORIZED="0"
Step 2 (OPTIONAL): Include the following lines in your android/app/proguard-rules.pro file (optional: if you are using Proguard):
-keep class videosdk.org.** { *; }
-dontwarn videosdk.org.**
Keep both lines. The -keep rule alone fails the R8 step with a missing-class error.
Step 3: Update your AndroidManifest.xml file for permissions.
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" />
</manifest>
The SDK adds its own screen-share foreground service and the FOREGROUND_SERVICE and FOREGROUND_SERVICE_MEDIA_PROJECTION permissions, so screen share needs no manifest entries from you.
Minimum OS/SDK versions
In your android/build.gradle file, update the minimum OS/SDK version to 24.
buildscript {
ext {
minSdkVersion = 24
}
}
The SDK needs React Native 0.74 or later.
Got a Question? Ask us on discord

