Appery QR and Barcode Scanner

The plugin provides a qr and barcode scanner utilizing the Google ML Kit Vision library on iOS and Android. The MLKit library is incredibly performant and fast.


Barcode Support

1d formatsAndroidiOS
Codabar
Code 39
Code 93
Code 128
EAN-8.
EAN-13
ITF
MSI
RSS Expanded
RSS-14
UPC-A
UPC-E
2d formatsAndroidiOS
Aztec
Codablock
Data Matrix
MaxiCode
PDF417
QR Code

ℹ️ Note that this API does not recognize barcodes in these forms:

  • 1D Barcodes with only one character
  • Barcodes in ITF format with fewer than six characters
  • Barcodes encoded with FNC2, FNC3 or FNC4
  • QR codes generated in the ECI mode

Usage

To use the plugin simply call window.cordova.plugins.mlkit.barcodeScanner.scan(options, sucessCallback, failureCallback). See the sample below.

window.cordova.plugins.mlkit.barcodeScanner.scan({}, (error, result) => {
  if (error) {
    // Error handling
  } else if (result) alert(JSON.stringify(result));
});

Plugin Options

The default types option is shown below.

const defaultOptions = {
  types: {
    Code128: true,
    Code39: true,
    Code93: true,
    CodaBar: true,
    DataMatrix: true,
    EAN13: true,
    EAN8: true,
    ITF: true,
    QRCode: true,
    UPCA: true,
    UPCE: true,
    PDF417: true,
    Aztec: true
  }
}

Output/Return value

result: {
  cancelled: boolean;
  text: string;
  format: string | undefined;
  type: string | undefined;
}