React Native QRCodeLocalImage (remobile)
A local qrcode image parse for react-native, support for ios and android
Installation
npm install @remobile/react-native-qrcode-local-image --save
Installation (iOS)
- Drag RCTQRCodeLocalImage.xcodeproj to your project on Xcode.
- Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag libRCTQRCodeLocalImage.a from the Products folder inside the RCTQRCodeLocalImage.xcodeproj.
- Look for Header Search Paths and make sure it contains $(SRCROOT)/../../../react-native/React as recursive.
Installation (Android)
...include ':react-native-qrcode-local-image'project(':react-native-qrcode-local-image').projectDir = new File(settingsDir, '../node_modules/@remobile/react-native-qrcode-local-image/android')
- In
android/app/build.gradle
...dependencies { ... compile project(':react-native-qrcode-local-image')}
- register module (in MainApplication.java)
...... // <--- import ...... @Overrideprotected List<ReactPackage> { ...... new RCTQRCodeLocalImagePackage() // <------ add here ......}
Usage
Example
'use strict'; var React = ;var ReactNative = ;var StyleSheet View Text = ReactNative; var Button = ;var QRCode = ; moduleexports = React; var styles = StyleSheet;
method
decode(path, callback)
path canbe local image or url