Re: Out of process download support
Re: Out of process download support
- Subject: Re: Out of process download support
- From: Scott Hancher <email@hidden>
- Date: Fri, 21 Feb 2014 16:21:53 -0800
I am observing documented behavior with the UIApplicationDelegate method application:handleEventsForBackgroundURLSession:completionHandler:. It's called when my application is re-launched in response to completing a download.
However, I never seem to be getting a call to NSURLSessionDelegate's URLSessionDidFinishEventsForBackgroundURLSession:, whether the app is relaunched by the system when the download completes or I relaunch the app prior to the download concluding. I am getting all the callbacks I had been getting already including notification that the download has finished, NSURLSessionDownloadDelegate's URLSession:downloadTask:didFinishDownloadingToURL:.
The documentation states that the completionHandler sent to application:handleEventsForBackgroundURLSession:completionHandler: can be safely invoked when URLSessionDidFinishEventsForBackgroundURLSession: is received. Because of this, I've opted to call the completionHandler on receiving NSURLSessionTaskDelegate's URLSession:task:didCompleteWithError: if it hasn't already been called from URLSessionDidFinishEventsForBackgroundURLSession:
Does this sound reasonable? Should I just not bother calling the completionHandler at all if I never receive a call to NSURLSessionDelegate's URLSessionDidFinishEventsForBackgroundURLSession:? Is there a better method to call it from?
Thank you,
Scott.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden