Quick start
Integrate the SDK
-
Import the SDK
- Add the @zegocloud/zego-uikit-prebuilt-video-conference-rn as dependencies.
yarnnpmyarn add @zegocloud/zego-uikit-prebuilt-video-conference-rn
1npm install @zegocloud/zego-uikit-prebuilt-video-conference-rn
1- Add other dependencies.
Run the following command to install other dependencies for making sure the
@zegocloud/zego-uikit-prebuilt-video-conference-rn
can work properly:yarnnpmyarn add @zegocloud/zego-uikit-rn react-delegate-component zego-express-engine-reactnative@3.14.5
1npm install @zegocloud/zego-uikit-rn react-delegate-component zego-express-engine-reactnative@3.14.5
1 -
Using the ZegoUIKitPrebuiltVideoConference component in your project
- Go to ZEGOCLOUD Admin Console, get the
appID
andappSign
of your project. - Specify the
userID
anduserName
for connecting the Video Conference Kit service. - Create a
conferenceID
that represents the video conference you want to start.
NoteuserID
andconferenceID
can only contain numbers, letters, and underlines (_).- Using the same
conferenceID
will enter the same video conference.
App.jsimport React, { Component } from 'react'; import ZegoUIKitPrebuiltVideoConference from '@zegocloud/zego-uikit-prebuilt-video-conference-rn' import { StyleSheet, View } from 'react-native'; export default function VideoConferencePage(props) { return ( <View style={styles.container}> <ZegoUIKitPrebuiltVideoConference appID={yourAppID} appSign={yourAppSign} userID={userID} // userID can be something like a phone number or the user id on your own user system. userName={userName} conferenceID={conferenceID} // conferenceID can be any unique string. config={{ onLeave: () => { props.navigation.navigate('HomePage') }, }} /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'flex-start', alignItems: 'flex-start' }, });
1 - Go to ZEGOCLOUD Admin Console, get the
Configure your project
Run & Test
Note
If your device is not performing well or you found a UI stuttering, run in Release mode for a smoother experience.
- Run on an iOS device:
yarn
npm
yarn ios
1
npm run ios
1
- Run on an Android device:
yarn
npm
yarn android
1
npm run android
1
Related guide
Resources
Sample Code
Click here to get the complete sample code.