mobile.scanBarCode

Allow the user to scan a barcode with a mobile device

Syntax

ui.Interface.frontCall("mobile", "scanBarCode",
   [], [code, type] )
  1. code - Holds a string representation of the barcode.
  2. type - Holds the name of the barcode type (EAN, UPC, CODE_39, CODE_128, QR, DATA_MATRIX, etc)

Usage

The "scanBarCode" front call starts the barcode scanner to let the user scan a barcode with the device.

Important:

To be usable with GBC, this front call needs a secure context / front-end connection, in addition to mobile device permissions, when required. A secure context is achieved by using the GAS via HTTPS, via localhost on the same machine, or running direct via GDC-UR. When using GDC-UR, additional security settings need to be enabled in the GDC configuration panel. See GDC documentation for more details.

If the barcode scan failed, the code return parameter is set to NULL and type is set to "canceled".

If case of successful barcode scan, the front call returns the string representation of the barcode (code) and the barcode symbology (type).

For details about barcode types supported by GBC/JS, see Barcode Detection API.