Create README.md

Add onBarCodeRead example
This commit is contained in:
superyarik 2017-06-08 15:43:22 +03:00 committed by GitHub
parent acc60d3cf8
commit 7755419215

View File

@ -120,6 +120,7 @@ class BadInstagramCloneApp extends Component {
ref={(cam) => {
this.camera = cam;
}}
onBarCodeRead={this.onBarCodeRead.bind(this)}
style={styles.preview}
aspect={Camera.constants.Aspect.fill}>
<Text style={styles.capture} onPress={this.takePicture.bind(this)}>[CAPTURE]</Text>
@ -127,6 +128,13 @@ class BadInstagramCloneApp extends Component {
</View>
);
}
onBarCodeRead(e) {
console.log(
"Barcode Found!",
"Type: " + e.type + "\nData: " + e.data
);
}
takePicture() {
const options = {};