|
| 1 | + |
1 | 2 | # react-native-scanbot
|
2 |
| -https://scanbot.io/en/sdk.html for react native |
| 3 | + |
| 4 | +## Getting started |
| 5 | + |
| 6 | +`$ npm install react-native-scanbot --save` |
| 7 | + |
| 8 | +### Mostly automatic installation |
| 9 | + |
| 10 | +`$ react-native link react-native-scanbot` |
| 11 | + |
| 12 | +### Manual installation |
| 13 | + |
| 14 | + |
| 15 | +#### iOS |
| 16 | + |
| 17 | +1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` |
| 18 | +2. Go to `node_modules` ➜ `react-native-scanbot` and add `RNScanbot.xcodeproj` |
| 19 | +3. In XCode, in the project navigator, select your project. Add `libRNScanbot.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` |
| 20 | +4. Run your project (`Cmd+R`)< |
| 21 | + |
| 22 | +#### Android |
| 23 | + |
| 24 | +1. Open up `android/app/src/main/java/[...]/MainActivity.java` |
| 25 | + - Add `import com.reactlibrary.RNScanbotPackage;` to the imports at the top of the file |
| 26 | + - Add `new RNScanbotPackage()` to the list returned by the `getPackages()` method |
| 27 | +2. Append the following lines to `android/settings.gradle`: |
| 28 | + ``` |
| 29 | + include ':react-native-scanbot' |
| 30 | + project(':react-native-scanbot').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-scanbot/android') |
| 31 | + ``` |
| 32 | +3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: |
| 33 | + ``` |
| 34 | + compile project(':react-native-scanbot') |
| 35 | + ``` |
| 36 | + |
| 37 | +#### Windows |
| 38 | +[Read it! :D](https://github.com/ReactWindows/react-native) |
| 39 | + |
| 40 | +1. In Visual Studio add the `RNScanbot.sln` in `node_modules/react-native-scanbot/windows/RNScanbot.sln` folder to their solution, reference from their app. |
| 41 | +2. Open up your `MainPage.cs` app |
| 42 | + - Add `using Com.Reactlibrary.RNScanbot;` to the usings at the top of the file |
| 43 | + - Add `new RNScanbotPackage()` to the `List<IReactPackage>` returned by the `Packages` method |
| 44 | + |
| 45 | + |
| 46 | +## Usage |
| 47 | +```javascript |
| 48 | +import RNScanbot from 'react-native-scanbot'; |
| 49 | + |
| 50 | +// TODO: What to do with the module? |
| 51 | +RNScanbot; |
| 52 | +``` |
| 53 | + |
0 commit comments