barCodeTypes is ignored on Android when type prop is specified on the BarCodeScanner
See original GitHub issue🐛 Bug Report
Limiting barcode types in expo-barcode-scanner using barCodeTypes doesn’t work on Android (iOS works fine) when type={BarCodeScanner.Constants.Type.back} is specified.
Environment
Expo CLI 3.13.2 environment info:
System:
OS: Linux 5.5 Arch Linux
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
Watchman: 4.9.0 - /usr/bin/watchman
npmPackages:
expo: ^36.0.0 => 36.0.2
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4
npmGlobalPackages:
expo-cli: 3.13.2
Targets: iOS, Android
Steps to Reproduce
Scan a QR code with barCodeTypes set to BarCodeScanner.Constants.BarCodeType.ean13 and type set to BarCodeScanner.Constants.Type.back with an Android device after reloading the app.
barcodeScanner:
<BarCodeScanner
type={BarCodeScanner.Constants.Type.back}
onBarCodeScanned={scanned ? undefined : handleBarcodeScanned}
barCodeTypes={[BarCodeScanner.Constants.BarCodeType.ean13]}
style={StyleSheet.absoluteFillObject}
/>
Expected Behavior
Only ean13 barcodes are scanned on both Android and iOS.
Actual Behavior
Non ean13 barcodes are scanned on Android.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
React native camera not working as expected with expo
The callback is provided with an object of the shape { type: BarCodeScanner.Constants.BarCodeType, data: string } , where the type refers to ...
Read more >Cognex Mobile Barcode SDK for Android | Using cmbSDK
Enable decoding only for the barcode types the application needs to scan. The cmbSDK supports the decoding of almost 40 different barcode types...
Read more >BarCodeScanner - Expo Documentation
An array of bar code types. Defaults to all supported bar code types on the platform. Note: Only QR codes are supported on...
Read more >Creating a Barcode Scanner using Android Studio - Medium
This article will guide you through creating an android application using which you can make use of your mobile camera to scan a...
Read more >android.device Class ScanManager
android.device. ... Get all values of given scanner configuration properties. ... Reset to factory default settings for all barcode symbology types.
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

Apologies. I kind of forgot about this issue. I updated to expo 37.0.0 and specifying
typeworks for me now (also works withouttypespecified).Hey, thanks for the response. I managed to reproduce it with your snack by adding
type={BarCodeScanner.Constants.Type.back}and reloading the app.