See Also: NSUrlSession Members
In iOS 7 and later, Foundation.NSUrlSession and related classes are the preferred way to transfer larger files to and from the Web.
Foundation.NSUrlSession downloads can work when the application is in the background.
Unlike regular tasks, background transfers are not constrained to 10 minutes, and instead will run until the transfer completes. Because background transfers are not bound by an arbitrary time limit, they can be used to upload or download large files, auto-update content in the background, and more.
The following example shows a download request, capable of asynchronously downloading a large file:
C# Example
var config = NSUrlSessionConfiguration.BackgroundSessionConfiguration(Guid.NewGuid().ToString()); var session = NSUrlSession.FromConfiguration(config, new SimpleSessionDelegate(), new NSOperationQueue()); var downloadTask = session.CreateDownloadTask(NSUrlRequest.FromUrl(url)); //Begin download, asynchronously downloadTask.Resume(); ... class SimpleSessionDelegate : NSUrlSessionDownloadDelegate { public override void DidFinishDownloading(NSUrlSession session, NSUrlSessionDownloadTask downloadTask, NSUrl location) { var file = File.OpenRead(location.Path); ... } }