You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stopDownload doesn't throw "error" promise on iOS while on Android, the promise continues with catch() block. Enclosing the code fragment
fetch = () => {
// progress callback besides other things, saves the jobId into the state
Service.download(country, this.progressCallback, this.onDownloadBegin)
.promise.then((filepath) => {
const data = this.prepareData(filepath);
this.setState({data});
})
.catch(error => this.catchDownloadError(error));
}
// this callback is called right after stopDownload() is called on android, but isn't called on iOS!
catchDownloadError = error => {
console.log(error);
}
cancelFetching = () => {
console.log("Stop download for jobId: ", this.state.jobId); // jobId is 1
// this statement ends successfuly so stopDownload is called!
if (this.state.jobId) {
RNFS.stopDownload(this.state.jobId);
}
};
Is this normaI behaviour? Is download cancelled on iOS same as on Android? Do I need to move my catch() block functionality right under RNFS.stopDownload() call for iOS? Does anyone have any suggestions please? Thanks!
Edit
There is a memory leak and when stopDownload is called and after that a go back from the current screen. My progress callback is still receiving data...
The text was updated successfully, but these errors were encountered:
sebqq
changed the title
stopDownload() not working on ios
Does stopDownload() works differently on iOS and Android?
Mar 11, 2019
sebqq
changed the title
Does stopDownload() works differently on iOS and Android?
Does stopDownload() work differently on iOS and Android?
Mar 11, 2019
stopDownload doesn't throw "error" promise on iOS while on Android, the promise continues with catch() block. Enclosing the code fragment
Is this normaI behaviour? Is download cancelled on iOS same as on Android? Do I need to move my
catch()
block functionality right underRNFS.stopDownload()
call for iOS? Does anyone have any suggestions please? Thanks!Edit
There is a memory leak and when stopDownload is called and after that a go back from the current screen. My progress callback is still receiving data...
The text was updated successfully, but these errors were encountered: