I am trying to save photo taken by the Camera to Pictures folder on my Android device.
It just not happening. Can anyone help me figure out what is wrong?
takePicture = async () => {
const { uri } = await this.camera.takePictureAsync();
console.log(‘uri’, uri);
const asset = await MediaLibrary.createAssetAsync(uri);
console.log(‘asset’, asset.filename);
MediaLibrary.createAlbumAsync(‘Pictures’, asset)
.then(() => {
Alert.alert(‘Album created!’)
})
.catch(error => {
Alert.alert(‘An Error Occurred!’)
});
this.setState({ photoId: this.state.photoId + 1 });
Vibration.vibrate();
}
my console return the uri after photo taken but asset.file is not returned it is like nothing is happening there. any help is appreciated.