BarcodeScanner Data Types
BarcodeScanner defines several data types.
An object representing a scanned barcode.
|type||The type of barcode that was recognized. Available values are enumerated in |
|value||String||The decoded value of the barcode.|
An object representing configuration details for a barcode scanning session.
|Optional. Specifies the types of barcodes to scan for. Available values are enumerated in |
|String||Optional. Provides instructions to display in the scanning interface. Defaults to no text.||'Scan the next item on the shelf'|
|String||Optional. Provides a message to display in the scanning interface when a barcode is successfully scanned. Defaults to no text.||'Item scanned'|
|Boolean||Optional. Indicates whether or not a check mark is displayed upon a successful scan. Defaults to |
|Boolean||Optional. Determines whether the device vibrates when a scan is successful. Defaults to |
|String||Optional. Modifies the size of the scanner camera view. The available options represent a percentage of the user's device screen size. ||'MEDIUM'|
|String||Optional. Specifies whether the front- or rear-facing camera is used. Defaults to 'BACK'. Available options include 'FRONT' and 'BACK'. If the user's device doesn't support the specified camera facing, an error is returned.||'FRONT'|
|String||Optional. Defines a custom UI for the scanner instead of using the standard UI. Defaults to none. If nothing is passed in for this parameter, the standard UI is used. If a custom UI is used, it completely replaces the standard UI, including the standard Cancel button used for dismissing the scanner. When defining a custom UI, it's the responsibility of the caller to handle dismissing the scanner.|
|Boolean||Optional. Determines whether the scanner animates in and out when presented and dismissed. Defaults to |
|Boolean||Optional. Determines whether the user has to manually confirm that a detected barcode should be scanned. Defaults to |
|Boolean||Optional. Determines whether the scanner displays the barcode data while scanning. Defaults to |
|Boolean||Optional. Determines whether the scanner collects the results of scanned barcodes before sending them back to the caller. Defaults to |
|Boolean||Optional. Determines whether the scanner detects multiple barcodes simultaneously. Defaults to |
An object representing an error that occurred when attempting to scan a barcode.
|code||A value representing the reason for the scanning failure. Possible codes include the following:|
|message||String||A string value explaining the reason for the scanning failure. This value is suitable for use in user interface messages. The message is provided in English, and isn’t localized.|
userDismissedScanner is returned when the user clicks the Cancel button during scanning. This is the normal method of terminating a scanning session. Your error handling can check for and possibly treat
userDismissedScanner differently from, for example, permissions errors.