barCodeScannerSettings -> barCodeTypes is not work in Android
See original GitHub issueSummary
Use Camera
component with barCodeScannerSettings={{ barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr] }}
to scan QR code, not only QR codes are scanned, but other types of codes are also scanned.
My test device : MI 6 / Android 9
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
44
Environment
expo-env-info 1.0.2 environment info: System: OS: Windows 10 10.0.22000 Binaries: Node: 16.13.1 - D:\Environment\Node.js\node.EXE Yarn: 1.22.15 - D:\Environment\Node.js\yarn.CMD npm: 8.5.5 - D:\Environment\Node.js\npm.CMD Expo Workflow: managed
Reproducible demo
import React from "react"
import { Camera } from "expo-scanner"
import { BarCodeScanner } from "expo-barcode-scanner"
const handleBarCodeScanned = ({ data,type }) => {
console.log(type)
console.log(data)
}
export const BarcodeScanner = () => (
<Camera
type={Camera.Constants.Type.back}
onBarCodeScanned={handleBarCodeScanned}
// not work below line
barCodeScannerSettings={{ barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr] }}
/>
)
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Why does the scanner / mobile device not read this bar code?
I can't read or scan the bar code with your product. Scanner will not scan barcode. CN51 Android unable to scan PDF417 and...
Read more >Why Aren't My Barcodes Scanning? 3 Common Problems ...
If your scanner is neither old, nor set to read the incorrect barcode language, your issue may have to do with programming (or...
Read more >ZXing Android Studio barcode scanner not working with large ...
I have developed an app for reading bar codes ...
Read more >How to Fix Barcode Scanner Not Working - Lose It! Support
Troubleshooting the Barcode Scanner · Open the Settings app · Apps · Select Lose It! · Permissions · Turn on Camera.
Read more >Scan barcodes with ML Kit on Android - Google Developers
You can use ML Kit to recognize and decode barcodes. There are two ways to integrate barcode scanning: by bundling the model as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also seeing this on a Pixel 6 Pro running Android 12 using this snack:
https://snack.expo.dev/@cfreear/basic-barcodescanner-usage
Its configured to only scan qr and code39 yet I was able to scan the aztec code on wikipedia here:
https://en.wikipedia.org/wiki/Aztec_Code
I can confirm the bug, barcodeTypes is not working . It is scanning all types of barcode despite of only mentioned types.