This sample demonstrates how to use the BarcodeScanner API from the Dynamsoft Barcode Reader JavaScript SDK in a Capacitor app to scan a single barcode using the camera.
We use typescript and rollup inside capacitor for demonstration. You can use any framework you like, or even vanilla javascript.
- Easy integration with pre-built UI
- Renders barcodeScanner inside a Capacitor container
- Scans one barcode at a time from video
npm install
npm run build
npx cap syncThen build your app in Android Studio and Xcode.
Notice we add camera permission in AndroidManifest.xml and Info.plist.
android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" /><key>NSCameraUsageDescription</key>
<string>Decoding barcodes from video needs to access your camera.</string>Please check the official documentation.
If you have any questions, feel free to contact Dynamsoft Support.