Created
February 5, 2018 08:59
-
-
Save chansuke/e13b0fd3b371bb693e75dbaf3f5306d2 to your computer and use it in GitHub Desktop.
Take a photo & save to camera roll.
This file contains hidden or 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
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