Skip to main content

showBarcodeScanner

Shows a barcode scanner using device's camera.

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"formats"BarcodeFormatDefines which barcode formats should be recognized.null
"onError"StringThe name of the event that will be triggered after action failed.null
"onErrorType"StringThe type of the error event.null
"onSuccess" (required)StringThe name of the event that will be triggered after action is performed successfully.null
"onSuccessType"StringThe type of the success event.null
"showCameraSwitch"Boolean,StringEnables/Disables camera switching functionality.null
"showOverlayView"Boolean,StringShows/Hides overlay of the scanners area.null
"showTorch"Boolean,StringEnables/Disables flashlight's functionality.null

Inherited

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType 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.