For the complete documentation index, see llms.txt. This page is also available as Markdown.

Barcode Scanner API

Scan barcodes and QR codes using the WebToNative JavaScript API. Enable fast, accurate code scanning in Android and iOS apps.

You'll need to import the javascript file in your website before starting from this link.
const { Format, BarcodeScan } = WTN.Barcode;
BarcodeScan({
  format: Format.QR_CODE, // optional
  onBarcodeSearch: (value) => {
    console.log(value);
  },
});
import { Format, BarcodeScan } from "webtonative/barcode"
BarcodeScan({
  format: Format.QR_CODE, // optional
  onBarcodeSearch: (value) => {
    console.log(value);
  },
});

BarcodeScan: Call BarcodeScan to scan barcode from native apps.

  • format: 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. Format.ALL_FORMATS

  2. Format.QR_CODE

  3. Format.UNKNOWN

  4. Format.CODE_128

  5. Format.CODE_39

  6. Format.CODE_93

  7. Format.CODABAR

  8. Format.EAN_13

  9. Format.EAN_8

  10. Format.ITF

  11. Format.UPC_A

  12. Format.PDF417

  13. Format.AZTEC

Last updated