iOS OperationQueue NSURLSession DownloadTasks Backgrounding

JakovljevicIgorJakovljevicIgor USMember ✭✭✭

Hi guys,

I am a bit confused by the iOS Backgrounding Tasks. So does the block "FinishLongRunningTask" execute in the background thread or the function that is passed to the completion handler of the "BeginBackgroundTask". Comming from C# this is kind of puzzling for me.

nint taskID = UIApplication.SharedApplication.BeginBackgroundTask( () => {});
FinishLongRunningTask(taskID);
UIApplication.SharedApplication.EndBackgroundTask(taskID);

I have registered the app as a background task app. In the "FinishLongRunningTask" I initialize a operationqueue with Async NSOperations that are basicaly DownloadTasks. With the Emulator the app functions as expected, but when running it on a Device it does not execute in the background.

Regards,
Igor

Sign In or Register to comment.