I am working on an application that needs to upload a large number of files to a server and would prefer to do this in the background to not impact the user experience.
I've read up on all the new ios 13 BGTasks (processing and app refresh) and after downloading the example project from Apple (color feed) and other projects from 3rd parties trying to show how to implement it; none of the projects are working and the tasks are never getting called. I've tried everything I could think of and all permutations of having the device plugged in or not and setting the tasks to need power/network or not and have not gotten a single successful trigger of either an app refresh or a processing task. The documentation by Apple is rather lacking and the only real direction we are given is to simulate a trigger using the console.
So my question is, are these tasks even useful for uploading data in the background (as I assumed the processing task would be) or is there a better method of it? Or is uploading of files in the background just not something iOS really allows?
How can I give my processing task the best chance of getting run?
In production, my experience is that these task tend to run overnight if the device has mains power. During development, you can use the facility described in WWDC 2019 Session 707 Advances in App Background Execution.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"