Dev Center
Table of contents

Why is the Javascript SDK not recognizing any barcodes on iOS 16.4?

« Back to FAQ index

Background

iOS 16.4 was released on March 27th, 2023. In this version, all browsers on iOS have begun to support OffscreenCanvas. Unfortunately, Apple’s implementation of the API is still incomplete and is missing the important feature “webgl context”. Please see the MDN docs on OffscreenCanvas for more details.

Impact

OffscreenCanvas is utilized in older versions of DBR-JS. Specifically in versions 7.5.0 ~ 8.8.7. However, we moved away from this API as of DBR-JS v9.0.0. Therefore, all 9+ versions are not affected by this breaking change.

If you encounter the issue, you will see the following error in the browser console:

ios-16-incompatible

Solution:

There are three solutions to the issue:

If it is convenient, we recommend that you upgrade to the latest v9.x version to avoid the issue. Please refer to the upgrade guide.

However, if you are not able to upgrade to the v9.x, please refer to the two options below.

Option 2: Disable the API directly before creating a BarcodeScanner instance

window.OffscreenCanvas = null;
let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
//...

NOTE:

If you application, or other libraries in your application, requires the use of OffscreenCanvas, then this approach will not be suitable, as the OffscreenCanvas would be disabled globally.

Option 3: Disable webgl context usage in DBR-JS

If you are unsure whether OffscreenCanvas can be disabled globally as suggested in Option 1, you can enable ifSaveOriginalImageInACanvas after creating the BarcodeScanner instance as a workaround.

let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
scanner.ifSaveOriginalImageInACanvas = true;
//...

NOTE

This approach may slow DBR-JS down a little bit, but the difference can be ignored on devices capable of running iOS 16.4.

If none of the options work for you, please contact us.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

latest version

    • Latest version(10.2.10)
    • Version 10.x
      • Version 10.0.21
      • Version 10.0.20
    • Version 9.x
      • Version 9.6.42
      • Version 9.6.40
      • Version 9.6.33
      • Version 9.6.32
      • Version 9.6.31
      • Version 9.6.30
      • Version 9.6.21
      • Version 9.6.20
      • Version 9.6.11
      • Version 9.6.10
      • Version 9.6.2
      • Version 9.6.1
      • Version 9.6.0
      • Version 9.3.1
      • Version 9.3.0
      • Version 9.2.13
      • Version 9.2.12
      • Version 9.2.11
      • Version 9.0.2
      • Version 9.0.1
      • Version 9.0.0
    • Version 8.x
      • Version 8.8.7
      • Version 8.8.5
      • Version 8.8.3
      • Version 8.8.0
      • Version 8.6.3
      • Version 8.6.0
      • Version 8.4.0
      • Version 8.2.5
      • Version 8.2.3
      • Version 8.2.1
      • Version 8.2.0
      • Version 8.1.3
      • Version 8.1.2
      • Version 8.1.0
      • Version 8.0.0
    • Version 7.x
      • Version 7.6.0
      • Version 7.5.0
    Change +