> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/device/barcodescanner.md).

# barcodeScanner

## Description

Activates a barcode scanner using the camera of the device.

## Input / Parameter

| Name                 | Description                                                                                       | Input Type  | Default | Options     | Required |
| -------------------- | ------------------------------------------------------------------------------------------------- | ----------- | ------- | ----------- | -------- |
| showFlipCameraButton | Show flip camera button. Supported on iOS and Android.                                            | Boolean     | true    | true, false | No       |
| showTorchButton      | Show torch button. Supported on iOS and Android.                                                  | Boolean     | true    | true, false | No       |
| torchOn              | Launch with the torch switched on (if available). Supported on Android only.                      | Boolean     | false   | true, false | No       |
| prompt               | Prompt text. Supported on Android only.                                                           | String/Text | -       | -           | No       |
| resultDuration       | Display scanned text for X ms. 0 suppresses it entirely, default 1500. Supported on Android only. | Number      | 500?    | -           | No       |

## Output

N/A

## Callback

### callback

The function to be executed if the barcode scanner is activated successfully.

### errorCallback

The function to be executed if the barcode scanner is not activated successfully.

## Video

Coming Soon.

## Example

The user wants to scan a barcode and display the value in a dialog.

### Steps

1. Drag a button to a page in the mobile designer. Select the event click and drag the barcodeScanner function to the event flow.

   ![](/files/OAVGtaO4hYcWAzRpAWhN)

   ![](/files/6gQ81NQUA2Nz3Hgi4nqF)
2. Drag the function to be executed when the barcode scanner is activated successfully. In this example, we are using the infoDialog function. Fill in the parameters of the function.

   ![](/files/y8VZ9Xgj0WfS6Fe34Ikt)

   ![](/files/Ln78WltSKqi5foES605A)

### Result

When the button is pressed, the barcode scanner will be activated. After scanning the barcode, the value will be displayed in a dialog box.

## Links
