Download the plugin via npm
$ NPM安装CMBSDK-React-Native -Save
Mostly automatic installation
$ React-Native Link CMBSDK-React-Native
Import the component in your react-native app by adding this
import { CMBReader, cmbComponent } from 'cmbsdk-react-native';
You can access all of the API methods through cmbComponent constant, and all of the enums and constants are available in the CMBReader class.
Before continuing, download the cmbSDK React-Native zip file from our download section, and see the API reference.
确保从下载页面下载了CMBSDK React-Native Zip存档。From the downloaded zip file, open the iOS directory.
1.如果您使用的是Mobile中内置的移动设备,请与位于IOS / Resources目录中的“MWBSCannerimages.xcassets”文件执行相同。必威随行版官网
2.在您的项目中,您需要添加密钥,具体取决于您正在使用的readerDevice类型。
And that's it. You should be able to run your app with the cmbSDK react-native module working.
确保从下载页面下载了CMBSDK React-Native Zip存档。从下载的zip文件中,打开android / cmbsdk-android-binary目录。
1.打开yourrnapp / android / app /directory, create a new folder named "libs" if there isn't one already, and open it. Place the file "cmbsdklib-release.aar" inside the libs folder. This aar can be found in "Android/cmbsdk-android-binary" from the downloaded zip file
2.打开位于的App Build.gradleyourrnapp / android / app并添加这些行:
- 依赖项上面添加了这一点:
repositories { flatDir { dirs 'libs' } }
3. Open the build.gradle located inyourRNApp/android并将Minsdkversion更改为19或以上
And that's it. You should be able to run your app with the cmbSDK react-native module working.