React Native
React Native is an open-source framework that allows developers to create native applications for iOS and Android. If you are looking to integrate Voximplant to React Web framework instead, see this article.
Get started with React Native for iOS
With React Native 0.60+ you can rely on the CLI autolink feature that links the module while building the app. In case you have React Native <= 0.59, perform manual installation:
- Make sure you have a React Native project created with
react-native init ProjectName
React Native SDK uses native modules. If you use the create-react-native-app utility, our SDK does not work because the utility does not allow to include custom native modules in a project.
- Run the following command in the direcroy where the package.json file is located:
npm install react-native-voximplant@latest --save
- Open or create the ios/Podfile file and add the following dependencies:
pod ‘react-native-voximplant’, path: ‘../node_modules/react-native-voximplant’
- Run the following command:
pod install from <your_project>/ios/
Start XCode and open generated .xcworkspace. Check that there are no *.xcodeproj files in the project (see the Libraries section). If there are any, please remove them. Since React dependencies are added via Podfile, double integration of its modules may lead to incorrect behavior of the application.
Run your project (Cmd+R).
Get started with React Native for Android
With React Native 0.60+ you can rely on the CLI autolink feature that links the module while building the app. In case you have React Native <= 0.59, run the following command:
react-native link react-native-voximplant
Manual installation for Android
In case something went wrong, you can proceed with manual installation:
- Make sure you have a React Native project created with
react-native init ProjectName
React Native SDK uses native modules. If you use the create-react-native-app utility, our SDK does not work because the utility does not allow to include custom native modules in a project.
- Run the following command in the direcroy where the package.json file is located:
npm install react-native-voximplant@latest --save
- Install Java 8 support. To do this, open the android/app/build.gradle file and add the following lines to the ‘android’ section:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
- Open the android/build.gradle file and update the Android plugin for gradle:
dependencies {
// use the latest available version
classpath 'com.android.tools.build:gradle:3.1.3'
}
- Open the android/gradle/wrapper/gradle-wrapper.properties file and edit the distributionUrl to gradle-4.4-all.zip:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
- Run the following command:
react-native link
Initialize the SDK
First, you need to import the Voximplant package, and get a client instance via the getInstance method:
Connect to the Voximplant cloud and login
Note that React Native SDK supports promises, i.e., you can handle any type of login independently since promises provide you an async/await construction. To connect to the Voximplant cloud, use the connect method, and to log into your user, use the login method.
See the following code example as reference:
Start implementing functionality
Now you have your application and SDK set up and successfully connected to the Voximplant cloud. To start implementing desired functionality, such as calls, conferences, messages, and more, go to the Guides section of our documentation and pick the features you need.
Download React native SDK demos
Implement the desired functionality by following step-by-step Guides or download and test our latest React native SDK here:
Call: Demonstrates how to create an application that uses the Voximplant React Native SDK and Voximplant cloud platform for making and receiving audio and video calls.
Conference: Demonstrates how to create an application that uses the Voximplant React Native SDK and Voximplant cloud platform for making conference calls. Using it, you can join conference calls, start and stop sending videos during a conference, mute audio, and many more.
Video conference: Demonstrates the basic video conferencing functionality of Voximplant's React Native SDK. Using it, you can join conferences, start and stop sending videos during a conference, mute audio, and many more.