简体   繁体   中英

Is uploading allowed in background fetch (PerformFetch)

I'm using C# (Xamarin) on iOS, but I suspect this question applies to those programming in Objective C as well. iOS 7 introduces the background "fetch" functionality which lets the app download data while it is in the background.

All of the docs I've read (on both Xamarin's and Apple's sites) state that this functionality is for downloading updates, and that you have around 30 seconds to finish the download; however, nowhere are restrictions stated. I'm wondering if it's acceptable for my app to also upload things to our servers when in the background.

Yes!

Sorry for the short answer. I have implemented fetch in one of my apps available in AppStore where I upload or download a very small txt file. You are right about 30 sec window. So far its been working fine with no problems.

You can even simulate fetch upload and download in your XCode simulator to see if you run into any time limit problem.

Again the point of fetch is to keep your upload / download data light and you already know that you cannot control how frequent fetch wakes up to do those action. It maybe every 10 mins or once a day depending upon users internet usage pattern.

Yes you can upload data/file whenever Background fetch method is triggered and you are right like rain about the 30 sec window.

I have managed to increase the 30 sec window to around 180 sec (3 mins) by combining the background fetch with UIBackgroundTaskIdentifier .

From iOS 7 180 sec (3 mins) is the maximum permitted time for iOS apps for background execution before the app goes into suspended mode, Earlier it was around 600 sec (10 mins).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM