Hello,
I’m trying to upload the user’s entire photo library to a server so this can mean thousands of files.
To achieve this task I'm trying to use a background URLSessionConfiguration with the following steps:
I also noticed that it looks like I’m hitting some kind of rate limiter. Even with the app in the foreground, the transfers stop reporting progress after some time and then start reporting again after a small amount of time. This doesn't happen with a normal URLSessionConfiguration.
So I was wondering if it was indeed the way to go or if there was some better/other way to do it ?
I’m trying to upload the user’s entire photo library to a server so this can mean thousands of files.
To achieve this task I'm trying to use a background URLSessionConfiguration with the following steps:
Fetch all the phassetid
For each phassetid, export the asset to my container
Create a file upload task using the background session
I also noticed that it looks like I’m hitting some kind of rate limiter. Even with the app in the foreground, the transfers stop reporting progress after some time and then start reporting again after a small amount of time. This doesn't happen with a normal URLSessionConfiguration.
So I was wondering if it was indeed the way to go or if there was some better/other way to do it ?
Back in the iOS 8 timeframe (IIRC this was discussed in WWDC 2014 Session 707 “What’s New in Foundation Networking” [1]) we set things up so that bringing your app to the foreground would boost the priority of any NSURLSession background session work that it’s doing. I haven’t researched this in detail in a long time, but anecdotal evidence suggests that this is no longer the case )-: If you’d like to see this behaviour back again, I recommend filing a bug along those lines.I tried using background NSURLSession in the foreground but it looks
like the rate limiter is still somehow active.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] No link because this video is not longer available )-: