Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

usetada/react-native-zbar-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages