React Native
Single Barcode Scanning
Single barcode scanning allows you to detect and process one barcode at a time within a predefined scanning window. This ensures precise detection by limiting the scan area, improving accuracy and performance.
⚙️ Configure the SDK
To enable single barcode scanning, you need to set mode
and isMultipleScanEnabled
props:
🤖 Auto Mode Barcode Scanning
For automatic barcode capture, set the captureMode
prop to auto
:
Example:
✋ Manual Mode Barcode Scanning
For manual barcode capture, set the captureMode
prop to manual
:
Example:
🎯 Focus Area Configuration
To define the scan region, use the imperative api method setFocusSettings and set focusImageRect
parameter:
🧭 Detection Indicators
To receive detection indicators in an event handler (without actual values), use the imperative method setObjectDetectionSettings
:
📦Event handler for Barcode Values
When a barcode is successfully scanned, the onBarcodeScan
event handler is called:
❗️Event handler for error
If an error occurs during the barcode scanning process, the onError
event handler will be called. You can implement this to handle any failures gracefully.
Use this method to log errors, display messages to the user, or perform recovery actions when scanning fails.
🧾 Barcode Object Structure
The DetectedBarcode
object returned in the onBarcodeScan
event has the following structure: