1.0.0 • Published 4 years ago
react-native-cbm-asr v1.0.0
react-native-baidu-asr
Getting started
$ npm install react-native-baidu-asr --save
Mostly automatic installation
$ react-native link react-native-baidu-asr
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-baidu-asrand addRNBaiduAsr.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNBaiduAsr.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNBaiduAsrPackage;to the imports at the top of the file - Add
new RNBaiduAsrPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-baidu-asr' project(':react-native-baidu-asr').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-baidu-asr/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-baidu-asr')
Windows
- In Visual Studio add the
RNBaiduAsr.slninnode_modules/react-native-baidu-asr/windows/RNBaiduAsr.slnfolder to their solution, reference from their app. - Open up your
MainPage.csapp
- Add
using Baidu.Asr.RNBaiduAsr;to the usings at the top of the file - Add
new RNBaiduAsrPackage()to theList<IReactPackage>returned by thePackagesmethod
Usage
import RNBaiduAsr from 'react-native-baidu-asr';
// TODO: What to do with the module?
RNBaiduAsr;1.0.0
4 years ago