I am using AFNetworking for download of files in one of my project.
Everything is working properly for download if my app is awake.
The error occurs in below scenario.
- I keep for download.
- I navigate away from app for 30+ seconds
- When I come back, it executes
setCompletionBlock
and because of this my download is incomplete.
If I comes back to app before 30 seconds, download continues.
Any idea how to solve this issue?
I tried setting timeout interval for NSURLRequest to 300, but still it execute setCompletionBlock
after 30 seconds.
NSURLRequest *request = [NSURLRequest requestWithURL:
[NSURL URLWithString:currentURL] cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:300];
operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation start];