Created
September 30, 2019 21:18
-
-
Save kevinvangelder/93e6a0f1f072696003c5ee5aec6210a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selectImage = () => { | |
const options = { | |
title: 'Select Image', | |
storageOptions: { | |
skipBackup: true, | |
path: 'images', | |
}, | |
}; | |
ImagePicker.showImagePicker(options, (response) => { | |
console.log('Response = ', response); | |
if (response.didCancel) { | |
console.log('User cancelled image picker'); | |
} else if (response.error) { | |
console.log('ImagePicker Error: ', response.error); | |
} else if (response.customButton) { | |
console.log('User tapped custom button: ', response.customButton); | |
} else { | |
const source = { uri: response.uri }; | |
this.setState({ | |
image: source, | |
predictions: null | |
}); | |
this.classifyImage() | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment