WASM: Most common pitfalls

1. Camera turning off after some time, what can be done? #

The behavior you're describing is caused by a scanner timeout. By default, a started scan will close in 60s if no barcode is found, or the user hasn't stopped the scan, either by calling stopScanner API method, or by navigating away from the page.

To change this, you can use the setScannerTimeout API method.

This method accepts any value between 10 and 3600, or 0 if you'd like to turn off the timeout completely:

                    Barkoder.setScannerTimeout(0);
            

2. Camera permissions are being requested every time on mobile. #

On iOS, camera permission is asked for from the user each time the page is loaded or reloaded, regardless of whether the user granted it in the previous session. This is true for Safari as well as for other browsers (e.g. Chrome), as they are using the WebKit engine.

The only way to change this behavior is for the user to manually change Safari settings for Camera access, selecting “Allow” instead of the default “Ask”.

3. StartScanner() takes a little longer to start #

When starting the camera (i.e. calling startScanning() ) for the very first time in a session, it is normal for the startup operation (completed when startScannerthe event is fired) to take a few seconds, typically between 2 and 4 seconds. Consecutive starts should be much faster.

A more detailed explanation as to why that is the case:

The camera starting process varies between platforms (even within the same platform - on iOS for example we've observed large differences between Safari and non-Safari browsers), in addition to the speed of the device.

In general starting the camera should be rather quick, typically under 1 second, but for the very first time in a given session, the SDK needs to perform certain checks to determine if needed functionalities are available, as well as ensure the best possible camera is used (this mostly matters for iPhones with multiple back cameras, as well as some Android devices, namely some Samsung Galaxy phones with multiple back cameras), and overall ensure smooth operation across all platforms.

4. Best settings for scanning a Tesla data matrix VIN through the windshield. #

To get the improved DataMatrix scanning, you do need to set a ROI and have DPM mode enabled (for the small Tesla datamatrix barcodes).

So this would look something like:

                    BarkoderInstance.setDatamatrixDpmModeEnabled(true);
    BarkoderInstance.setRegionOfInterest(0, 40, 100, 20); //this is what our SDK developer suggests 
    to use as ROI values for this specific case
            

You can also look at Enable DPM Mode on the WASM Platform

5.

Page Contents

History:

close