-
Notifications
You must be signed in to change notification settings - Fork 549
Description
Apple platform
iOS + Catalyst
Framework version
net9.0-*
Affected platform version
.NET 8+
Description
I've been experimenting with allowing you to do large file downloads on iOS even if the app is getting backgrounded.
The current HttpMessageHandler.SendAsync doesn't really support this approach, so for now in my experiment I added a new Task<HttpResponse> DownloadFileAsync(...) method to NSUrlSessionHandler to support this.
This might not be the best way to do it, but it was one way I could simply do it while piggybacking on all the other work there's already in NSUrlSessionHandlerDelegate.
I think there's room to consider adding some better support for this in the .NET iOS SDK, and I'm creating this issue to initiate those discussions.
Steps to Reproduce
I have a sample repository with a forked version of NSUrlSessionHandler. I tried keeping my changes to a separate file, which thanks to all the partial classes was pretty easy to do.
Repo here: https://github.com/dotMorten/iosBackgroundDownload/
Main additions are all in this file.