Hi,
we are doing an application that needs to potentialy transfer a lot of files from a server to an iPad before it goes offline. So we are using the NSUrlSession do to background transfer with a periodic background fetch to enqueue the files to downloads when we didn't succeed to enqueue all of them when our application was in foreground (or to download new files). The BeginBackgroundTask helps us get more times, but it's far from being infinite.
The issues we encountered with this implementation is the background transfer is not made to transfer too much files at the same time (the nsurlsessiond process ends-up with 100%+ CPU usage which will crash from times to times because of ">50% CPU over 180s", and after queueing too much requests, sometime the API calls to queue new background downloads will blocks, even on iOS 9.1, and even after unintalling our application).
But when we tested other apps doing file transfer for offline usage, we noticed some other apps can successfully transfert 6000+ files in background without any issue, eg.: Box (https://itunes.apple.com/ca/app/box-for-iphone-and-ipad/id290853822). When we profile it using apple Instruments Activity monitor, we notice the Box process can run for 20+ minutes without being killed with "Application didn't leave it in time" as it usually happens when you don't stop you code from executing before the backgroundTimeRemaining reach 0 (the % CPU column never reach 0%).
So the question: any idea how Box managed to keep their own code running past the usual backgroundTimeRemaining limitation?
Thanks!