I need to download hundreds of files part of a media file. Lets say 1000 small downloads(1mb each). In a loop, for each file I'm creating a download task and resume it like the code below.
NSUrlSessionDownloadTask downloadTask = session.CreateDownloadTask(request);
downloadTask.Resume();
The tasks start fine and files are download. The problem is when the app goes to the background.
This is the session configuration that I'm using:
sessionConfig.AllowsCellularAccess = true;
sessionConfig.SessionSendsLaunchEvents = true;
sessionConfig.NetworkServiceType = NSUrlRequestNetworkServiceType.Default;
sessionConfig.HttpMaximumConnectionsPerHost = 4;
sessionConfig.Discretionary = false;
Here's my questions:
Delegate methods are only called when going back to the app..or when all download tasks are finished, is this the expected behaviour? Going back to the app will trigger hundreds of events..and that takes a while!
Does the NSUrlSession has any limits for the amount of download tasks?