mobile.scanBarCode
Allow the user to scan a barcode with a mobile device
Syntax
ui.Interface.frontCall("mobile", "scanBarCode",
[], [code, type] )
- code - Holds a string representation of the barcode.
- 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.
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.