Я использую RNFetchBlob, чтобы поделиться изображением в формате base64. Но изображение загружается в мою локальную папку. Я хочу его удалить. По моим исследовательским знаниям я хочу отключить путь к изображению. Я не знаю, как это сделать. Вот мой код
_downloadImageAndShare(url ,title, message) {
const { fs } = RNFetchBlob.fs;
const self = this;
RNFetchBlob.config({ fileCache: true })
.fetch('GET', url)
.then(resp => resp.readFile('base64')
.then(base64 => ({ resp, base64 })))
.then(obj => {
const headers = obj.resp.respInfo.headers;
const type = headers['Content-Type'];
const dataUrl = 'data:' + type + ';base64,' + obj.base64;
return { url: dataUrl, title, message };
})
.then(options => Share.open(options)).catch(err => {err &&
console.log(err); })
}
как использовать этот код внутри этого метода
RNFetchBlob.fs.unlink(path)
.then(() => { ... })
.catch((err) => { ... })
а как указать unlink (путь) ??
заранее спасибо.