On this page

Stuck? Open a support ticket and the barKoder team will help. Open a ticket

Continuous scanning

What is Continuous Scanning for React Native? #

Continuous Scanning is a feature in barcode scanning applications that allows for repeated scanning of barcodes without manually restarting the scanning process after each successful scan. It is implemented by configuring the scanner to keep the session open and adjusting the delay between duplicate scans.

How to enable continuous scanning? #

To enable continuous scanning, add the following code:

JavaScript
_barkoder.setCloseSessionOnResultEnabled(false);
_barkoder.setThresholdBetweenDuplicatesScans(0); // it can take values -1, or n > 0

Duplicate Scan Control #

The thresholdBetweenDuplicatesScans property controls how repeated barcode detections are handled
JavaScript
_barkoder.setThresholdBetweenDuplicatesScans(0); // it can take values -1, or n > 0
ValueBehavior
-1Ignores duplicates completely — each barcode is scanned only once.
0Allows scanning the same barcode continuously, with no delay between scans.
n > 0Allows scanning the same barcode again only after n seconds.

When using continuous you need to disable the thumbnails as returning those on the Android platform will create performance issues
JavaScript
barkoder.setImageResultEnabled(false);
barkoder.setBarcodeThumbnailOnResultEnabled(false);