Miss any of our Open RFC calls?Watch the recordings here! »

react-native-zbar-android

0.0.3 • Public • Published

react-native-zbar-android

npm version npm version

Fast QR Code Scanner for Android based on https://github.com/ZBar/ZBar

Demo

Installation Android

  1. npm install react-native-zbar-android --save
  2. react-native link react-native-zbar-android

Usage

 
import { startScan } from 'react-native-zbar-android'
import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  ToastAndroid,
  View
} from 'react-native';
 
class MyPickers extends Component {
 
  render () {
    startScan(this._onBarCodeRead.bind(this))
    return (
      <View/>
    )
  }
 
  _onBarCodeRead (QRCodeResult) {
    if (QRCodeResult.state === 'ok') {
      let result = QRCodeResult.code
      ToastAndroid.show(result, ToastAndroid.SHORT);
    }
  }
}
 

Questions or suggestions?

Feel free to open an issue

Install

npm i react-native-zbar-android

DownloadsWeekly Downloads

4

Version

0.0.3

License

MIT

Last publish

Collaborators

  • avatar