提示: 由于时间关系,目前对七牛实时视频语音封装还不完善,只是简单的搭了个框架,只是简单实现了视频会话,后期会持续完善
$ npm install react-native-qiniu --save
$ react-native link react-native-qiniu
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-qiniu
and addRNQiniu.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNQiniu.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.qiniulibrary.RNQiniuPackage;
to the imports at the top of the file - Add
new RNQiniuPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-qiniu' project(':react-native-qiniu').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-qiniu/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-qiniu')
import RNQiniu from 'react-native-qiniu';
// TODO: What to do with the module?
RNQiniu;