I do not know the reason. But the app stops. after finishing downloading the file. on android devices.
works fine until you finish the download
Does anyone have any suggestions?
export const downloadFile = (userUid, video, teacher) => {
return (dispatch) => {
let download = '';
RNFetchBlob
.config({
fileCache : true,
})
.fetch('GET', video.video, {
Authorization : 'Bearer access-token...',
})
.progress((received, total) => {
//alert('progress' + (received / total) )
let progress = (received / total) *100
dispatch({
type:'progressDownload',
payload:{
key: video.key,
progress: progress
}
});
})
// when response status code is 200
.then((res) => {
//FIM DO CARREGAMENTO
dispatch({
type:'finishDownload',
payload:{
key: video.key,
progress: 100,
status: 'completed',
locate: {
path: res.path(),
}
}
});
})
// Status code is not 200
.catch((errorMessage, statusCode) => {
alert(errorMessage)
})
} }