1.1.2 • Published 4 years ago

react-native-rn-zxing v1.1.2

Weekly downloads
52
License
-
Repository
-
Last release
4 years ago

react-native-rn-zxing

🔥 Finally 🔥 ... an easy way to implement an efficient QR Code scanner (Zxing based) using React native.

Getting started

$ npm install react-native-rn-zxing --save

Mostly automatic installation

$ react-native link react-native-rn-zxing

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RnZxingPackage; to the imports at the top of the file
  • Add new RnZxingPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-rn-zxing'
    project(':react-native-rn-zxing').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-rn-zxing/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-rn-zxing')

Usage

import RnZxing from 'react-native-rn-zxing';

...
// Pass the callback as a parameter
RnZxing.showQrReader(this.onBarcodeScanned);

...
// Define the callback function to handle data after scan
onBarcodeScanned = (data) => {
        this.setState({data: data});
};
1.1.1

4 years ago

1.1.2

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago