kesha-antonov / react-native-background-downloader

About A library for React-Native to help you download large files on iOS and Android both in the foreground and most importantly in the background.
https://www.npmjs.com/package/@kesha-antonov/react-native-background-downloader
Other
26 stars 3 forks source link

Test on ios simulator? #2

Open sjchristi opened 2 months ago

sjchristi commented 2 months ago

Hi,

This is perhaps more of a question than a bug report. I was trying to test this on iOS simulator. I wanted to test the case of my application being closed while a download was in progress.

So what I did was I launched my app, kicked off a huge download, and then hit the home button twice and swiped up to close my app.

I then reopened my app and I'm calling this API:

    let lostTasks = await RNBackgroundDownloader.checkForExistingDownloads();

And sure enough, there is a task for the download!

Unfortunately, immediately after this, I receive this error:

 LOG  Download canceled due to error:  The operation couldn’t be completed. (NSURLErrorDomain error -999.)

I'm not sure if my testing is throwing things off or if I'm doing something wrong? Is there special handling that I need to do?

Thanks! Sam

kesha-antonov commented 2 months ago

Hi, Thanks for the report, I'll look into it

felipegmg commented 2 months ago

+1