Skip to main content
Version: 4.62

showBarcodeScanner

Opens a camera view with custom overlay for barcode reading functionality. Depending on the configuration, different options are available through the overlay's interface.

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.false
"showOverlayView"Boolean,StringShows/Hides overlay of the scanners area.true
"showTorch"Boolean,StringEnables/Disables flashlight's functionality.true

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: Scan Barcodes

Show ExampleHide Example

The onSuccess and onError params determine what happens depending on the result of the showBarcodeScanner action.

{
"type": "showBarcodeScanner",
"params": {
"onSuccess": "barcodeScanSuccess",
"onError": "barcodeScanError"
}
}
The app showing the results of the sample code from Example 1.The app showing the results of the sample code from Example 1.