react-native-camera-android
react-native-camera-android copied to clipboard
Barcode scanning is not working.
I just tried this plugin and though the camera works but it can't read barcodes. Neither does it shows viewFinder even after setting up all the prop for viewFinder. Any idea what might be causing this issue?
I'm having exactly the same issue. torchMode={"on"} doesn't work either. (Using React 0.21). All I get is the camera showing a live view with no viewfinder and _barcodeReceived isn't called.
Any help would be appreciated. Thanks.
I'm using the following:
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
Dimensions
} from 'react-native';
import CameraAndroid from 'react-native-camera-android';
class TestApp extends Component {
_barcodeReceived(e) {
console.log("here", e);
}
render() {
return (
<View style={styles.container}>
<CameraAndroid
style={{flex: 1,justifyContent: 'flex-end',alignItems: 'center',height: Dimensions.get('window').height,width: Dimensions.get('window').width}}
ref="cam" // the reference of your camera view
type={"back"} // the type of your camera
autoFocus={true}
torchMode={"on"} // flashlight settings of your camera
viewFinderDisplay={true} // set it to true if you want to scan barcodes
onBarCodeRead={this._barcodeReceived}
/>
{/*<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.android.js
</Text>
<Text style={styles.instructions}>
Shake or press menu button for dev menu
</Text>*/}
</View>
);
}
}
UPDATE: Just to note I have tested this both on a physical device (Nexus 5x Android 6.0.1) and Genymotion (Nexus 5 Android 6.0.0 API 23)
I am also facing the same, it is not scanning any barcode/qrcode
Did you find any solution for this issue??