Re: Background tasks completing without notification
Re: Background tasks completing without notification
- Subject: Re: Background tasks completing without notification
- From: Scott Hancher <email@hidden>
- Date: Wed, 05 Mar 2014 11:34:36 -0800
NSURLSession's finishTasksAndInvalidate was causing me issues with a previous problem, but that's been resolved. Just to make sure though I commented out calls to finishTasksAndInvalidate and NSURLSessionTask's cancel, and the problem still occurs.
My current observations are that the task has completed, since -getTasksWithCompletionHandler: returns 0 tasks. Due to a race condition, I've relaunched our app before NSURLSession's background task has gotten around to relaunching it. At this point, I need a callback from the session/task to notify me of this completion; otherwise, I have no means to determine the result of the completed task. I'm expecting to get this callback to my delegate on the NSURLSession recreated on relaunching my app and assigned through the method +sessionWithConfiguration:delegate:delegateQueue:. I do get the callback -URLSession:task:didCompleteWithError: some of the time, but it's not 100% reliable.
I am testing this on the simulator, so suggestions on exploring it further are certainly welcome.
Thank you for the detailed response and related posts. I did read through them, but gleaned no further course of action to take on my problem.
++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