Skip to content

Instantly share code, notes, and snippets.

@chansuke
Created February 5, 2018 08:59
Show Gist options
  • Save chansuke/e13b0fd3b371bb693e75dbaf3f5306d2 to your computer and use it in GitHub Desktop.
Save chansuke/e13b0fd3b371bb693e75dbaf3f5306d2 to your computer and use it in GitHub Desktop.
Take a photo & save to camera roll.
import { CameraRoll } from 'react-native'
_takePhoto = async () => {
const result = await ImagePicker.launchCameraAsync({
allowEditing: false,
exif: true
});
if (!result.cancelled) {
this.setState({ image: result.uri });
}
this._uploadImage(this.state.image);
CameraRoll.saveToCameraRoll(this.state.image);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment