import RNFetchBlob from 'rn-fetch-blob';
const downloadFile = (url, path) => { return RNFetchBlob.config({ fileCache: true, addAndroidDownloads: { useDownloadManager: true, notification: true, path: path, mime: 'application/octet-stream', description: 'File downloaded by download manager.', title: 'File download', }, }) .fetch('GET', url) .then((res) => { console.log('The file saved to:', res.path()); }) .catch((err) => { console.log('error:', err); }); };