$ npm install react-native-agora-rte-chatview --save
$ react-native link react-native-agora-rte-chatview
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-agora-rte-chatview
and addRNAgoraRteChatview.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNAgoraRteChatview.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.agorarte.chat.RNAgoraRteChatviewPackage;
to the imports at the top of the file - Add
new RNAgoraRteChatviewPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-agora-rte-chatview' project(':react-native-agora-rte-chatview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-agora-rte-chatview/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-agora-rte-chatview')
import RNAgoraRteChatview from 'react-native-agora-rte-chatview';
const chatInfo = {
appKey: "1129210531094378#apaas-edu",
chatRoomId: '185131943919617',
nickName: 'ssssssss',
roomUuid: 'rrrrrrrr0',
userName: 'c71db6b1dadb6bf72adf083611e2150b',
}
<RNAgoraRteChatview style={{flex:1}} chatInfo= {chatInfo} />
// TODO: What to do with the module?
RNAgoraRteChatview;