I implemented NSURLSession, which runs in the background (so that it can continue the task using the system daemon even when the application is paused). The problem is that
-(void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveResponse:(NSURLResponse *)response completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler
never called. I need to know the status of the response so that I can correctly handle the download error. According to another post, an Apple engineer said that this delegate method is not called when the session is in the background to prevent the application from waking up. Any suggestion on how to solve this problem? The last URLSession delegation method that is called in my situation:
-(void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data
ios ios7 nsurlsession
Nikos M. Mar 18 '14 at 17:58 2014-03-18 17:58
source share