Barcode Scanner

Barcode Scanning support for IOS 7+
n0pre55ure14.10.110
platforms: ios
$ cordova plugin add com.gtech.cadence.barcodescanner

BarcodeScanner

iOS 7+ BarcodeScanner for Cordova.

Using the plugin

The plugin creates the object window.plugins.barcodeScanner with the method scan(success, fail).

Installation

Automatically (CLI)

$ cordova plugin add https://github.com/n0pre55ure/com.gtech.cadence.barcodescanner.git
$ cordova prepare

success and fail are callback functions. Success is passed an object with data, type and cancelled properties. Data is the text representation of the barcode data, type is the type of barcode detected and cancelled is whether or not the user cancelled the scan.

An example could be:

   window.plugins.barcodeScanner.scan(
      function (result) {
          alert("We got a barcode\n" +
                "Result: " + result.text + "\n" +
                "Format: " + result.format + "\n" +
                "Cancelled: " + result.cancelled);
      }, 
      function (error) {
          alert("Scanning failed: " + error);
      }
   );