saveToCameraRoll = () => {
const{selectedImage, downlaodUrl} = this.state
let url = downlaodUrl[0].url;
ToastAndroid.show("Image is Saving...", ToastAndroid.SHORT)
if (Platform.OS === 'android'){
RNFetchBlob
.config({
fileCache : true,
appendExt : 'jpg'
})
.fetch('GET', url)
.then((res) => {
console.log()
CameraRoll.saveToCameraRoll(res.path())
.then((res) => {
console.log("save", res)
ToastAndroid.show("Image saved Successfully.", ToastAndroid.SHORT)
}).catch((error) => {
ToastAndroid.show("Ops! Operation Failed", ToastAndroid.SHORT)
})
})
} else {
CameraRoll.saveToCameraRoll(url)
.then(alert('Success', 'Photo added to camera roll!'))
ToastAndroid.show("Image saved Successfully.", ToastAndroid.SHORT)
}
}