1.6.0 • Published 6 years ago
react-native-ocr-lib v1.6.0
react-native-ocr-lib
Getting started
$ npm install react-native-ocr-lib --save
Mostly automatic installation
$ react-native link react-native-ocr-lib
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-ocr-lib
and addRNMyOcrLibNew.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNMyOcrLibNew.a
to 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.RNMyOcrLibNewPackage;
to the imports at the top of the file - Add
new RNMyOcrLibNewPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:
include ':react-native-ocr-lib'
project(':react-native-ocr-lib').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ocr-lib/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:
compile project(':react-native-ocr-lib')
###libraries Used
-->Google Vision for OCR
//compile 'com.google.android.gms:play-services-vision:11.0.4'
-->Realm for data save in DB
//compile 'io.realm:realm-android:0.87.4'
##Java Files
//ImagesRecord modle class for DB
//RNOCRlibModule main functionalities for wrapper
//Methods : extractImageData() native method for communcating with react native and get saved image path in device
//RNOcrLibPackage packager class for adding module class in library
# react-native-ocr-lib
## Getting started
`$ npm install react-native-ocr-lib --save`
### Mostly automatic installation
`$ react-native link react-native-ocr-lib`
## Usage
```javascript
import RNOcrLib from 'react-native-ocr-lib';
// TODO: What to do with the module?
RNOcrLib;
//in react native where you want native method to perform task
RNOcrLib.extractImageData(DataToSend);