其他语言版本: 简体中文
This tutorial describes how to create an Agora account and build a sample app with Agora using React Native.
The React Native SDK source can be found here, checkout here for the full API Reference.
- Agora.io Developer Account
- react-native 0.58.x
- nodejs v10.15.x
- iOS & Android sdk
- real mobile phone
This repository shows you how to use Agora React Native SDK to build a simple video call app. It demonstrates you how to:
- Join / leave a channel
- Mute / unmute audio
- Switch camera views
- Layout multiple video views
To build and run the sample application, first obtain an app ID:
- Create a developer account at agora.io. Once you finish the sign-up process, you are redirected to the dashboard.
- Navigate in the dashboard tree on the left to Projects > Project List.
- Copy the app ID that you obtain from the dashboard into a text file. You will use this when you launch the app.
Open the settings.js file and add the app ID.
const APPID = "";
Run the below commands in this project directory:
npm install
react-native link react-native-agora
react-native link react-navigation
react-native link react-native-gesture-handler
react-native link react-native-vector-icons
Once the build is complete, run the run
command to start the package server.
# start app
npm run start
react-native run-android
cd ios; pod install
open ios/AgoraRNQuickStart.xcworkspace
open in xcode- Find Libraries -> RCTAgora.xcodeproj -> Build Phases -> Link Binary With Libraries -> AgoraRtcEngineKit.Framework
and replace by
ios/Pods/AgoraRtcEngine_iOS/AgoraRtcEngineKit.Framework
- xcode build
cd into_your_project_path
npm install react-native-agora --save
react-native link react-native-agora
- build and run it.
you can run
react-native run-android
directly to build android platform.
- you should add
pod "react-native-agora", path: "../node_modules/react-native-agora"
in to Podfile and install the pod bypod install
- open the
.xcworkspace
in xcode. - add
RCTAgora.xcodeproj
to Libraries. - find
AgoraRtcEngineKit.framework
from yourPods
folder and replaceAgoraRtcEngineKit.framework
inRCTAgora
by dragging it into Your Project -> Libraries -> RCTAgora.xcodeproj -> Build Phases -> Link Binary With Libraries
- Complete API documentation at the Developer Center
- File bugs about this sample
- React Native Getting Started
This software is under the MIT License (MIT).