Wat happen when we start a request and we enter the background before the request is finished ? Do we have to cancel it ? What is the right way to do so ?
PS : i don’t want my download to continue when the user enter background.
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From the documentation you will see that to continue a request in the background, you need to specifically request that action using;
The corollary is that if you don’t specifically enable it, the download will be cancelled. You should not need to take specific action to do so.
EDIT: Looking at the source, it looks like the download won’t explicitly be cancelled by ASIHTTPRequest, but will fail to complete because the operating system is likely to do so for you. If you really want to be sure that it cancelled, perhaps because something nasty happens if you don’t, you can always use;
when you go to the background.
Personally I prefer to be in control of what is going on and would explicitly cancel things I wasn’t expecting to finish due to going into the background. It’s cleaner and safer because you know 100% what is going on.