ZBar

Contents

The ZBar Scanner Plugin allows you to scan 2d barcodes.

https://github.com/tjwoon/csZBar

Installation

ionic cordova plugin add cordova-plugin-cszbar npm install @ionic-native/zbar

Supported Platforms

  • Android
  • iOS

Usage

import { ZBar, ZBarOptions } from '@ionic-native/zbar';

constructor(private zbar: ZBar) { }

...

let options: ZBarOptions = {
      flash: 'off',
      drawSight: false
    };

this.zbar.scan(options)
   .then(result => {
      console.log(result); // Scanned code
   })
   .catch(error => {
      console.log(error); // Error message
   });