react-native-qrcode-scanner icon indicating copy to clipboard operation
react-native-qrcode-scanner copied to clipboard

Barcode scanning

Open Adwich opened this issue 7 years ago • 5 comments

Hello everyone, I'm using react-native-qrcode-scanner to scan qrcode and it work great. But I saw that it also can read barcodes given that react native camera can. My problem is that I've tried with barcodes but I can't get any reading.

What's happening?

I can't scan a barcode.

How can it be reproduced?

Here is the code I'm using. I've tried scanning all the barcode I have. To reproduce it just try scanning any barcode.

import QRCodeScanner from 'react-native-qrcode-scanner';
/* ... */
onRead = e => {
       console.log(e);
}
/*...*/

render() {
  return (
<QRCodeScanner
       onRead={this.onRead.bind(this)}
	ref={node => {
		this.scanner = node;
	}}
	reactivateTimeout={300}
/>
)}

Build details?

I'm working on Android with these :

"react": "^16.2.0",
"react-native": "^0.51.1",
"react-native-camera": "^1.0.3",
"react-native-qrcode-scanner": "^1.0.1"

Adwich avatar Apr 09 '18 02:04 Adwich

Wondering if it's working fine with QR codes?

moaazsidat avatar Apr 10 '18 04:04 moaazsidat

Yeah no problem regarding scanning a Qrcode. But for any barcode I can't get it to work. Is there a specific setting to be able to scan one ?

Adwich avatar Apr 10 '18 07:04 Adwich

Hmm, it shouldn't be preventing that, there is a setting to scan different types in react-native-camera, but by default it should be supporting all types, look at the doc link below, as well as the barCodeTypes prop below onBarCodeRead: https://github.com/react-native-community/react-native-camera/blob/master/docs/RNCamera.md#onbarcoderead

moaazsidat avatar Apr 10 '18 16:04 moaazsidat

I finally found that i can only scan barcode if my phone is scanning while oriented in landscape. I get the same behaviour in react-native-camera.

Anyway, thank you guys for your help

Adwich avatar Apr 12 '18 03:04 Adwich

I get the same result scanning barcode while oriented in landscape

mark5566 avatar Nov 20 '18 00:11 mark5566