Merge pull request #746 from superyarik/master
Add onBarCodeRead example
This commit is contained in:
commit
6bc1de69d7
|
@ -132,6 +132,7 @@ class BadInstagramCloneApp extends Component {
|
||||||
ref={(cam) => {
|
ref={(cam) => {
|
||||||
this.camera = cam;
|
this.camera = cam;
|
||||||
}}
|
}}
|
||||||
|
onBarCodeRead={this.onBarCodeRead.bind(this)}
|
||||||
style={styles.preview}
|
style={styles.preview}
|
||||||
aspect={Camera.constants.Aspect.fill}>
|
aspect={Camera.constants.Aspect.fill}>
|
||||||
<Text style={styles.capture} onPress={this.takePicture.bind(this)}>[CAPTURE]</Text>
|
<Text style={styles.capture} onPress={this.takePicture.bind(this)}>[CAPTURE]</Text>
|
||||||
|
@ -140,6 +141,13 @@ class BadInstagramCloneApp extends Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onBarCodeRead(e) {
|
||||||
|
console.log(
|
||||||
|
"Barcode Found!",
|
||||||
|
"Type: " + e.type + "\nData: " + e.data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
takePicture() {
|
takePicture() {
|
||||||
const options = {};
|
const options = {};
|
||||||
//options.location = ...
|
//options.location = ...
|
||||||
|
|
Loading…
Reference in New Issue