Mil0R3
Mil0R3

Reputation: 3956

continue downloading when application enter background

I tried ASIHttpRequest to download a file, but when the app enter background, it would stop downloading seconds later, is there any way to download a file completely in background?

Upvotes: 2

Views: 466

Answers (1)

Maximilian Litteral
Maximilian Litteral

Reputation: 3089

You have to set the download request to be able to continue in background.

[self.downloadRequest setShouldContinueWhenAppEntersBackground:YES];

self.downloadRequest is the ASIHTTPRequest, so just replace that with yours, add this line after you init it, and then it will continue in background:]

Upvotes: 4

Related Questions