In iOS's Background Tasks framework, what is the difference between BGAppRefreshTaskRequest and BGProcessingTaskRequest, and when do you use each?
answer
- how long, and how often
- fetch mode versus processing mode
- idle device, external power, network
- one pending refresh, ten processing
basics
~20 sBGAppRefreshTaskRequest asks iOS for a brief background launch to fetch small content updates; BGProcessingTaskRequest asks for minutes of deferrable work such as maintenance, which runs only while the device is idle. iOS decides when either runs.
solid answer
~40 sBoth are `BGTaskRequest` subclasses submitted to `BGTaskScheduler.shared`, and iOS launches the app when it judges the moment right, never on a fixed schedule. `BGAppRefreshTaskRequest` is for short content updates, such as a podcast app pulling its latest episode list: the task it produces is a `BGAppRefreshTask`, it needs the `fetch` background mode, and only one refresh request can be pending at a time. `BGProcessingTaskRequest` is for work that takes minutes, such as pruning the download cache: it adds `requiresNetworkConnectivity` and `requiresExternalPower` (both default `false`), its `BGProcessingTask` runs only while the device is idle and is terminated when the person starts using the device, it needs the `processing` background mode, and up to ten can be pending.
go deeper
Recall the two classes and one job each: refresh for a quick content update, processing for minutes of maintenance. Say plainly that iOS, not the app, decides when either runs.
Explain the knobs: earliestBeginDate as a lower bound, requiresNetworkConnectivity and requiresExternalPower on processing only, the fetch and processing background modes, and the one-refresh, ten-processing pending limit.
Show you size work to the launch you get: refresh work that fits a short run, processing work that survives being stopped when the person picks up the device, and a new request submitted on every run.
Treat the choice as a per-feature contract: which launch type it relies on, which identifier and background mode it adds to the app, and what the person sees when the work runs late.
## Two requests, one scheduler Background work in iOS's **Background Tasks** framework starts with a **request**: an instance of a `BGTaskRequest` subclass that the app submits to `BGTaskScheduler.shared`. The request runs nothing by itself. It asks the system to launch the app in the background later, at a moment the system chooses from conditions such as battery, network and how the person uses the app. When that moment comes, the system calls the **launch handler** the app registered for the request's identifier and hands it a **task** object, a `BGTask` subclass, through which the app reports how the work ended. The two everyday request classes, both available since iOS 13, are `BGAppRefreshTaskRequest` and `BGProcessingTaskRequest`. Choosing between them is choosing what kind of time the app asks for. ## App refresh: short content updates The header describes `BGAppRefreshTaskRequest` as a request to launch the app "briefly so that you can download data and keep your app's contents up-to-date". In a podcast app it is the request behind refreshing the episode list overnight, so the newest episodes are already listed when the listener opens the app. - The task it produces is a **`BGAppRefreshTask`**. - The app must declare **`fetch`** in the `UIBackgroundModes` Info.plist array, the array Xcode's Background Modes capability edits. - Apple's guide to choosing background strategies says the system gives a refresh launch **up to 30 seconds** of runtime. - At most **one** refresh request can be pending at any time. Submitting again with the same identifier replaces the pending request. - Its only scheduling condition is `earliestBeginDate`, inherited from `BGTaskRequest`. ## Processing: minutes of deferrable work `BGProcessingTaskRequest` is for "deferrable, longer-running processing, such as syncing, database maintenance, or similar tasks" that "can take minutes to complete". In the podcast app it fits cleaning the download cache: deleting played episodes and compacting the local database while the phone charges. - The task it produces is a **`BGProcessingTask`**, and the app must declare **`processing`** in `UIBackgroundModes`. - **`requiresNetworkConnectivity`** (default `false`) limits launches to times the device has a network connection. With `false`, the header warns, the app may have no network access during the run. - **`requiresExternalPower`** (default `false`) limits launches to times the device is on external power and also disables the CPU Monitor. The header recommends `true` for resource-intensive work, and notes that `false` does not mean the system will schedule the task on battery. - Processing tasks run **only while the device is idle**, and the system terminates a running one when the person starts using the device. Refresh tasks are not affected by that rule. - Up to **ten** processing requests can be pending at once. - The header says the system attempts a processing request within the next two days, as long as the person has used the app within the past week. ## Side by side | | `BGAppRefreshTaskRequest` | `BGProcessingTaskRequest` | |---|---|---| | Typical job | Fetch a small content update | Maintenance, sync, database or model work | | Runtime | Short; the strategy guide says up to 30 seconds | Can take minutes | | Conditions | `earliestBeginDate` only | Adds `requiresNetworkConnectivity`, `requiresExternalPower` | | Background mode | `fetch` | `processing` | | Pending at once | 1 | 10 | | Person starts using the device | Not affected | Running task is terminated | ## What both share Whichever class the app picks, the same five steps apply: 1. Every identifier is listed in the **`BGTaskSchedulerPermittedIdentifiers`** Info.plist array. 2. The app registers a launch handler for it with `register(forTaskWithIdentifier:using:launchHandler:)` before it finishes launching. 3. The app submits the request. **`earliestBeginDate` is only a lower bound**: the header says the system "doesn't guarantee launching the task at the specified date, but only that it won't begin sooner." 4. The launch handler assigns an `expirationHandler` and calls `setTaskCompleted(success:)` when the work ends. 5. A request runs once. To run again, the app submits a new request, usually from inside the launch handler. How often the system grants these launches, and why a design must never count on them, is covered in the mobile system design material on background limits; here the point is which request asks for which kind of time. ## The other request classes Two later subclasses serve narrower jobs. **`BGHealthResearchTaskRequest`**, added in iOS 17, is a processing request for apps that hold the health research entitlement and run studies a person has opted into. **`BGContinuedProcessingTaskRequest`**, added in iOS 26 for iOS and iPadOS, differs in kind: the person starts the job from the foreground with a tap, it begins at once, and the system shows its progress. Neither replaces the two everyday classes for work the app schedules on its own initiative.
- With BGTaskScheduler, what happens when a podcast app submits a second BGAppRefreshTaskRequest under a different identifier while one is pending?Submission fails with the `tooManyPendingTaskRequests` error: the scheduler allows one pending refresh request in total, and ten processing requests. Resubmitting under the same identifier is different, because it replaces the pending request. So features that all want a refresh share one identifier and one handler.
- On a BGProcessingTaskRequest, does leaving requiresExternalPower at false mean the task will run on battery?No. `false` only removes the requirement; the header says the system still may not schedule the task on battery, depending on the device and conditions. Setting `true` restricts launches to external power and disables the CPU Monitor, which the header recommends for resource-intensive work.
- Why can a processing task submitted tonight still not have run two days later?The header promises only a best effort within about two days, and only if the person used the app in the past week. The task also needs an idle device and any network or power condition you set. Those conditions may simply not have lined up.
An app refresh request is like asking a neighbour to glance at your mailbox whenever they happen to pass; a processing request is like setting the dishwasher to run once the house is asleep. In neither case do you choose the exact time.
- earliestBeginDate makes the task start at exactly that time
- A BGProcessingTask keeps running after the person picks up and uses the device
- An app can keep several app refresh requests pending under different identifiers
- Processing requests need no background mode; only app refresh needs one
- BGAppRefreshTaskRequest has requiresExternalPower just like the processing request
Assumes the iOS 27 SDK; app refresh and processing requests date from iOS 13, health research requests from iOS 17 and continued processing from iOS 26.