Search code examples
iosios7multitaskingbackground-fetch

How often is background fetch executed in iOS?


In iOS 7, a background fetch mode is supported for apps to fetch data when the app is not frontmost:

When it is convenient to do so, the system launches or resumes the app in the background and gives it a small amount of time to download any new content.

My question is: how often is the background fetch code executed?

If I set the minimum interval:

[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:10];

Does it get execute every 10 seconds, or maybe once a day? What kind of interval should I expect, generally?


Solution

  • There is no way for you to know how often, it is up to things like the users usage pattern, device battery and whatever else Apple has in their algorithms...

    The minimumBackgroundFetchInterval can be used to specify that your app doesn't need to run fetch so often, it does not make the fetch happen more often. You also have the minimum possible value in UIApplicationBackgroundFetchIntervalMinimum, which is what you can use if you want the background fetch to run as often as possible (but still no guarantee on how often it will actually run).