[ad_1]
I’ve been trying on the choices obtainable to do a person pushed on demand sync of a big knowledge set (roughly 1gb) to a iOS machine from a central server. The intention is that the person will go offline a while after the sync is full, and use the app in offline mode for a while afterwards. Nevertheless, I’m working into quite a lot of iOS restrictions that appears to forestall this.
The beginBackgroundTask doesn’t permit sufficient time to finish a sync earlier than its suspended because it solely permits as much as 30 seconds of background processing. I’ve seen just a few references to this being elevated through the use of audio or gps features nevertheless neither of those are relevant to my state of affairs.
The BGProcessingTask apis are on the programs discretion as to when they’re run, so usually are not sutiable for an on demand course of.
The NSURLSession api permits for downloads to happen whereas the app is suspended, nevertheless the issue with this api is that it requires the server to extract all needed knowledge to a short lived file earlier than it may be downloaded, this course of can take a number of minutes. This introduces the issue the place the appliance may be suspended earlier than the server has accomplished producing the file to obtain.
I am conscious a background push can be utilized to wake the app and begin the obtain utilizing the NSURLSession api if the app has been suspended, nevertheless this method locations the execution of the obtain again on the discretion of the OS which might result in important delays within the sync truly beginning, which makes for a fairly undesirable answer.
Its additionally price noting that precalculating and caching the information to obtain prematurely will not be a viable possibility as a result of variety of updates that happen and totally different permutations of knowledge relying on permissions assigned to every person.
With that, are there any apis that I’ve not thought of, or any misinterpretations to those above that may permit me to realize an on demand sync of such a big knowledge set?
It appears iOS is lacking the flexibility for a person to explicitly choose in to beginning a protracted working course of and permit it to proceed until full. I might assume another enterprise apps would have come throughout the same downside earlier than, and I’d be gratefull to see how its been solved.
[ad_2]
