
Barcode Scanning on iOS: The Missing Web API and a WebAssembly Solution
If you've ever tried to build a web based barcode scanner targeting iOS, you've likely hit a wall: Safari doesn't support the Barcode Detection API ^. tldr; Live demo: https://eringen.com/workbench/wasm-barcode/ ^ (NPM version) source version: https://eringen.com/workbench/wasm-barcode/index2.html ^ (With rotation passes visible) The Problem The Barcode Detection API is part of the Shape Detection API spec and provides a clean, native way to detect barcodes from images or camera feeds in the browser. Chrome on Android has supported it for a while, but Safari and by extension every browser on iOS, since they all use WebKit under the hood simply doesn't implement it. This means any web app relying on BarcodeDetector will silently fail on iPhones and iPads. For projects that need crossplatform barcode scanning without a native app, this is a dealbreaker. The Usual Workarounds Most JavaScript barcode libraries tackle this with pure JS decoding. They work, but the performance cost is notice
Continue reading on Dev.to
Opens in a new tab



