The table below describes the parameters included in the options
object,
which may be structured as follows:
{ scanMode, characterSet, cropArea, cameraType }
Parameter | Description | Type |
---|---|---|
scanMode | Defines the scan mode. The value of "SCAN_MODE_ALL" means that the scanner will attempt to detect all supported barcode types. This is the default mode. The value of "SCAN_MODE_PRODUCT" means that the scanner will attempt to detect product type barcodes. "SCAN_MODE_1D" means that the scanner will attempt to detect all one dimensional barcode types (1D). The value of "SCAN_MODE_QR_CODE" means that the scanner will attempt to detect QR barcodes. "SCAN_MODE_DATA_MATRIX" means that the scanner will attempt to detect data matrix type barcodes. | String |
characterSet | Optional parameter that specifies the character encoding to use when decoding barcode data. The parameter supports the following values: "Shift_JIS", "UTF-8", and "ISO-8859-1". This parameter is not supported on iOS. |
String |
cropArea | Optional parameter, a JSON structure containing two fields:
The whole available area is scanned by default. This parameter is not supported on iOS. |
Object |
cameraType |
Optional parameter that specifies the camera that is used to scan the barcode:
This parameter is not supported on Android. |
String |
The scan
method's callbacks
object can be structured
as follows:
{ onSuccess: function ( {data, format} ) { ... }, onCancel: function ( ) { ... }, onFailure: function ( {code, description} ) { ... } }
The table below lists callback methods included in the callbacks
object.
Name | Description | Return type |
---|---|---|
onSuccess | Invoked when the scan has been successful. A JSON object passed as its parameter specifies the scanned data and its format. | undefined |
onCancel | A callback method invoked when a scan has been canceled by the user. | undefined |
onFailure | A callback method invoked when a scan has failed for any reason. A JSON object passed as parameter contains detailed information about the error. | undefined |