How accurate is BGTaskScheduler?

When I submit a request for a background refresh through BGTaskScheduler, how likely is it that iOS will execute the task at the time I request?

I know that with the pre-iOS 13 way of doing this, iOS didn't really guarantee any particular schedule or frequency except that it it would try to execute the task when it wasn't busy. I don't see any language in BGTaskScheduler that talks about this. The only clue is that the field specifying the time is called "earliestBeginDate" which suggests that iOS might execute it later than that date.

If I submit a BGProcessingTaskRequest instead of a BGAppRefreshTaskRequest, does this change the behavior?

I'd like to know this so that I can tell my users what to expect.

Thanks, Frank

Answered by DTS Engineer in 746242022

Background Tasks Resources has a bunch of useful links here. Specifically, I recommend WWDC 2020 Session 10063.

In terms of the Background Tasks framework:

  • App refresh task are like any other ‘background fetch’ task. They are run by the system when it thinks your app needs a refresh. You have virtually no control over this. It’s primarily driven by device condition and user activity. An app that the user runs infrequently is likely to receive no app refresh time.

  • Processing tests are typically run overnight when the device is on mains power.

Share and Enjoy

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

Accepted Answer

Background Tasks Resources has a bunch of useful links here. Specifically, I recommend WWDC 2020 Session 10063.

In terms of the Background Tasks framework:

  • App refresh task are like any other ‘background fetch’ task. They are run by the system when it thinks your app needs a refresh. You have virtually no control over this. It’s primarily driven by device condition and user activity. An app that the user runs infrequently is likely to receive no app refresh time.

  • Processing tests are typically run overnight when the device is on mains power.

Share and Enjoy

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

How accurate is BGTaskScheduler?
 
 
Q