Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 642
NeoWang Avatar asked Mar 19 '15 14:03

NeoWang


People also ask

How long iOS app can run in background?

Tasks are under a strict time limit, and typically get about 600 seconds (10 minutes) of processing time after an application has moved to the background on iOS 6, and less than 10 minutes on iOS 7+.

What is background fetch in iOS?

The background Fetch API allows an app to get updated content when the app isn't running in the foreground. iOS intelligently schedules the background fetch events based on your app usage so when you open your app the content is always up to date.

Is background app refresh necessary on iPhone?

If you want quick multitasking and app updates, this is a necessary trade-off. But if you don't care about that convenience, you can extend both your battery life and data plan by disabling Background App Refresh.

What is background fetch?

The Background Fetch API provides a method for managing downloads that may take a significant amount of time such as movies, audio files, and software.


1 Answers

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).

like image 152
osanoj Avatar answered Sep 28 '22 15:09

osanoj