Links
Comment on page

Barcode Scan

You'll need to import the javascript file in your website before starting from this link.
Plain Javascript
ES5+
const {Format, BarcodeScan} = WTN.Barcode;
BarcodeScan({
formats: Format.QR_CODE, // optional
onBarcodeSearch: (value) => {
console.log(value);
},
});
import {Format, BarcodeScan} from "webtonative/barocode"
BarcodeScan({
formats: Format.QR_CODE, // optional
onBarcodeSearch: (value) => {
console.log(value);
},
});
BarcodeScan: Call BarcodeScan to scan barcode from native apps.
  • formats: This is optional parameter is you don't pass it, it will try to scan all the available barcode formats listed below.
  • onBarcodeSearch: This callback function will be called when it successfully scans barcode.

Format Types

Following is the list of all the supported format types
  1. 1.
    Format.ALL_FORMATS
  2. 2.
    Format.QR_CODE
  3. 3.
    Format.UNKNOWN
  4. 4.
    Format.CODE_128
  5. 5.
    Format.CODE_39
  6. 6.
    Format.CODE_93
  7. 7.
    Format.CODABAR
  8. 8.
    Format.EAN_13
  9. 9.
    Format.EAN_8
  10. 10.
    Format.ITF
  11. 11.
    Format.UPC_A
  12. 12.
    Format.PDF417
  13. 13.
    Format.AZTEC