Description
Hello, I'm trying this module in my app for download,but I get a crash when I set "useDownloadManager" to false
For some reason , I need to manager the download progress, as if I user the android donwload manager, the progress method will not work, so I think I MUST set useDownloadManager to false,
But, when I set it to false, whatever I download, my app crash everytime
I know this is exactly the same as #561,
but that issue haven't resolved either,
RNFetchBlob
.config({
addAndroidDownloads: {
fileCache: true,
useDownloadManager: true,
notification: true,
title: name,
mime:'image/png',
description: 'downloading...',
path: RNFetchBlob.fs.dirs.DownloadDir + '/' + name,
},
})
.fetch('GET', url)
.progress((received, total) => {
Listener.emit('downloadProgress', received, total)
console.log(received, total)
})
.then(res => {
let filePath = res.path()
console.log(filePath)
Listener.emit('downloadFinish', {id, filePath})
SQLite.updateDownloadState(id, 1)
})
.catch(err => {
console.log(err)
SQLite.updateDownloadState(id, 2)
})
Here is my code:
"react": "16.3.1",
"react-native": "0.55.4",
"rn-fetch-blob": "^0.10.13"