Clarification Needed: Background App Refresh Interval

Hi,


We are developing a React Native iOS app that uses Background App Refresh to fetch data from server. We use a library called react-native-background-fetch. The readme of this library said that it's impossible to schedule a background task rate to less than every 15 minutes.


Because this library implements Background App Refresh and requires "Background Fetch" for Background Modes, I also checked the iOS documentations for background execution. What I have found in the explanation for setMinimumBackgroundFetchInterval: is that, it says "This value is advisory only and does not indicate the exact amount of time expected between fetch operations." and no notes are provided for UIApplicationBackgroundFetchIntervalMinimum.


We have also searched some of the questions on Stack Overflow and have got some ideas, but I would still prefer an authoritative answers from iOS engineers from Apple. So my questions are:


In the documentation, for setMinimumBackgroundFetchInterval:, there is no indications for something like a range of interval that we can expect. We are experiencing the background app refreshes as frequent as around 15 minutes to more to 6 hours. Is this the normal expected behavior and is there a range of interval that we can expect?


Any suggestions on what can we do in the app to "tell" the iOS system to schedule as many background app refresh fetches operations as possible?


It would be great if we can have an official clarification and suggestions on this topic and we really appreciate your help.


Thanks,

Ryan

We are experiencing the background app refreshes as frequent as around 15 minutes to more to 6 hours. … is there a range of interval that we can expect?

The expected range can vary wildly. It will never be less than the minimum that you’ve specified, but it can be much longer.

Keep in mind that the goal of background fetch is to allow an app to update so that it appears ‘live’ to the user. Thus the rate at which you get background fetch events is very much dependent on user behaviour. For example:

  • If the user runs your app often, it’s likely you’ll get frequent background fetch events.

  • If the user runs your app at specific times of the day, the system may notice this and give you a background fetch event shortly before that time.

  • If the user runs your app very rarely, the system may cut you off from background fetch events entirely.

Any suggestions on what can we do in the app to "tell" the iOS system to schedule as many background app refresh fetches operations as possible?

No. That’s not something that’s aligned with background fetch’s goals.

My general advice is to not rely on background fetch for critical functionality. It’s great for keeping things looking ‘live’, but if being up to date is a critical part of your app’s user experience then you should explore other options, and specifically you should look at moving this work to a server and then notifying the user of events via a push notification. That way you can user mains power for this polling, rather than eating into the user’s battery.

You can also notify your app of these events via a silent push notification, but be aware that these are subject to a budget and thus you may run into problems like you’re seeing with background fetch.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank you very much for your timely and detailed answers. I find the insights and design ideas really helpful.

Does it mean it depends on the application usage … ?

Yes. If you’re curious how this stuff fits together, we gave a great talk about it at WWDC [checks calendar] last year, namely WWDC 2020 Session 10063 Background execution demystified.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Clarification Needed: Background App Refresh Interval
 
 
Q