Skip to content

Commit

Permalink
Merge pull request react-native-camera#746 from superyarik/master
Browse files Browse the repository at this point in the history
Add onBarCodeRead example
  • Loading branch information
sibelius authored Dec 7, 2017
2 parents 087c6c1 + 090aadc commit 6bc1de6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,21 @@ 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>
</Camera>
</View>
);
}

onBarCodeRead(e) {
console.log(
"Barcode Found!",
"Type: " + e.type + "\nData: " + e.data
);
}

takePicture() {
const options = {};
Expand Down

0 comments on commit 6bc1de6

Please sign in to comment.