mirror of
https://github.com/zhigang1992/agora-react-native-rtm.git
synced 2026-01-12 17:12:26 +08:00
Agora RTM Example for React Native
English | 中文
This Tutorial will help you get agora-react-native-rtm integrated directly into your iOS/Android applications using with agora rtm sdk and react native.
With this sample app, you can:
- Join / Leave Channel
- Send / Receive Channel Messsages
Prerequisites
- Agora.io Developer Account
- Xcode latest (10.0+)
- Android Studio latest
- nodejs LTS
- typescript
- cocoapods & android sdk & gradle plugin
- react-native (0.59.x)
- real mobile phone or emulator
Quick Start
This section shows you how to prepare, build, and run the sample application.
Obtain an App ID
To build and run the sample application, get an App ID:
- Create a developer account at agora.io. Once you finish the signup process, you will be redirected to the Dashboard.
- Navigate in the Dashboard tree on the left to Projects > Project List.
- Save the App ID from the Dashboard for later use.
Update and Run the Sample Application
Open the project folder and edit the agora.config.json file. Update YOUR_APP_ID with your app ID.
Setup
Step 1. install node dependencies & link react native modules
Run the below commands in this project folder:
npm install
react-native link agora-react-native-rtm
react-native link react-navigation
react-native link react-native-gesture-handler
react-native link react-native-vector-icons
Step 2. start react native package server
Once the build is complete, run the npm run start comamnd to start the package server.
npm run start
Step 3. run in native platform
Android Platform
react-native run-android
iOS Platform
cd ios; pod installopen ios/chatsapp.xcworkspacefill with valid developer account identity & signingxcode build
Resources
- You can find full API document at Document Center
- You can file bugs about this demo at issue
- React Native Getting Started
- agora-react-native-rtm docs
License
The MIT License (MIT)