0.0.10 • Published 5 years ago
react-native-idcard-reader v0.0.10
react-native-idreader
Getting started
$ npm install react-native-idreader --save
iOS
Manual installation
Using CocoaPods
To install with CocoaPods, add the following to your Podfile
:
# Flexbox Layout Manager Used By React Native
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
# React Native
pod 'React', path: '../node_modules/react-native', subspecs: [
# Comment out any unneeded subspecs to reduce bundle size.
'Core',
'DevSupport',
'RCTActionSheet',
'RCTAnimation',
'RCTBlob',
'RCTCameraRoll',
'RCTGeolocation',
'RCTImage',
'RCTNetwork',
'RCTPushNotification',
'RCTSettings',
'RCTTest',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'RCTLinkingIOS'
]
# idreader
pod 'react-native-idreader', :path => '../node_modules/react-native-idreader'
Then run pod install
and rebuild your project.
Android
Mostly automatic installation
$ react-native link react-native-idreader
Manual installation
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.tydic.idreader.RNIdreaderPackage;
to the imports at the top of the file - Add
new RNIdreaderPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-idreader' project(':react-native-idreader').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-idreader/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-idreader')
Usage
import RNIdreader from 'react-native-idreader';
RNIdreader.registerApp()
await RNIdreader.scan()
await RNIdreader.read()
// TODO: What to do with the module?
RNIdreader;