OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

Background work is a negotiation: WorkManager types and iOS minutes

Android sorts background tasks into immediate, long-running and deferrable with declarative constraints; iOS gives you minutes-long windows it schedules itself. Design for the scheduler you have.

OOmnistu
Reviewed 2026-11-19 · 3 min read

Every mobile app eventually wants to do work when nobody is looking at it: sync the feed, upload the photos, refresh the cache, process the queue. Both platforms allow it, neither trusts you with it, and the APIs they give you are shaped entirely by battery politics. Understanding the shape of those APIs - what they guarantee, what they merely attempt - is the difference between reliable background sync and a bug report that says "it only works when the app is open."

Android: pick the work type first

WorkManager, the recommended API for background work on Android, sorts every task into one of three types, and the type decides the guarantee. Immediate work must begin at once and finish soon, and may run as expedited. Long-running work is for tasks that might exceed ten minutes. Deferrable work is scheduled for later and can repeat periodically - this is where periodic sync lives. On top of the types sit constraints, declared rather than coded: run only on an unmetered network, only when charging, only with adequate storage. You describe the conditions, the system chooses the moment. That inversion - you ask, the OS decides - is the whole mental model.

iOS: minutes, and only when the system says so

Apple's BackgroundTasks framework exists, in its own words, to keep app content up to date and to run tasks "requiring minutes to complete" while the app is backgrounded. You register launch handlers for the framework's task types and schedule them as needed; the system launches your app in the background when it judges conditions right. Longer tasks can lean on external power, network connectivity and the GPU on supported devices. There is no promise your task runs at 3 AM; there is a promise that if it runs, you get a bounded window measured in minutes.

The design consequences

Chunk everything. Because windows are bounded and interruption is normal, background work must be resumable: process in batches, checkpoint progress, and make re-execution harmless. A sync that restarts from zero every time is a sync that never finishes on a bad network.

Declare honest constraints. Asking for unmetered-network-only is a feature users feel in their data bills. Asking for more than you need is how your work gets deprioritized by the very scheduler you are pleading with.

Foreground first for user-initiated work. If the user tapped "upload," do the upload with visible progress and let the background path finish stragglers. Apple's framework explicitly supports starting critical jobs in the foreground and completing them in the background if the user leaves - use that shape instead of pretending the background is a server.

Testing the untestable-feeling

The honest summary

Background execution is a negotiation. Android's WorkManager gives you three task types and declarative constraints; iOS gives you minutes-long windows it schedules itself. Both reward the same design: small, resumable, idempotent units of work with honest constraints. Build for the scheduler you have, not the cron daemon you miss.

Sources

Prepared with AI assistance and reviewed before publication. API behavior is drawn from the Android Developers and Apple Developer documentation checked on 19 November 2026; the design guidance is editorial practice.