showBarcodeScanner
Shows a barcode scanner using device's camera.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"formats" | BarcodeFormat | Defines which barcode formats should be recognized. | null |
"onError" | String | The name of the event that will be triggered after action failed. | null |
"onErrorType" | String | The type of the error event. | null |
"onSuccess" (required) | String | The name of the event that will be triggered after action is performed successfully. | null |
"onSuccessType" | String | The type of the success event. | null |
"showCameraSwitch" | Boolean,String | Enables/Disables camera switching functionality. | null |
"showOverlayView" | Boolean,String | Shows/Hides overlay of the scanners area. | null |
"showTorch" | Boolean,String | Enables/Disables flashlight's functionality. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Create a showBarcodeScanner action.
Goal: Create a showBarcodeScanner
action with enabled torch
, camera switch
, overlay view
functionality, define qr
, ean8
as recognized barcode formats and provide onSuccess
and onError
events to it.
showTorch
, showCameraSwitch
, showOverlayView
, formats
, onSuccess
and onError
keys have to be assigned within the params
object of the action.
{
"type": "showBarcodeScanner",
"params": {
"showTorch": true,
"showCameraSwitch": true,
"showOverlayView": true,
"formats": [
"qr",
"ean8"
],
"onSuccess": "barcodeScanSuccess",
"onError": "barcodeScanError"
}
}
Result:
A showBarcodeScanner
action with described requirements is created.