React Native
Multiple Barcode Scanning
Multiple Barcode Scanning is a mode in the Vision SDK that allows you to scan and detect multiple barcodes within the camera frame simultaneously. This is useful in scenarios where several barcodes are present in a single image or view, and you want to capture all of them in one go.
Unlike single barcode scanning, this mode does not restrict detection to just one barcode. Instead, it returns an array of all valid barcodes detected within the scanning region, improving efficiency for batch processing or document scanning use cases.
Configure the SDK
To enable multiple 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:
Detection Indicators
To receive detection indicators in an event handler (without actual values), use the imperative method setObjectDetectionSettings:
Event Handler for Barcode Values
When barcode(s) are successfully scanned, the onBarcodeScan event handler is called with enhanced metadata for each barcode:
Event Handler for Errors
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.
Enhanced Barcode Object Structure
When multiple barcodes are detected, each barcode in the array contains enhanced metadata:
Barcode Metadata Fields
Enhanced barcode metadata is available on both iOS and Android platforms starting from v1.5.18+. Each barcode in the array contains complete metadata including position information, which is useful for UI overlays and barcode validation.