iOS background setup
Background Location requires a staged permission experience: demonstrate the foreground feature with When In Use, then ask for Always only when the user enables a feature that must run while the app is not active.
Feature-to-capability map
Do not add Always access, the location background mode, or Motion usage text to an app that does not ship the corresponding feature.
Add product-specific purpose text
These are examples of specificity, not store-ready copy for every app. State the actual user benefit and keep the in-app explanation consistent with the system prompt and store privacy disclosure.
In Xcode, open the app target's Signing & Capabilities, add Background Modes, and enable Location updates. The equivalent plist entry is:
For standalone activity events or trackingMode: 'activityAware', also add:
Request access in stages
- Request When In Use when the user starts the foreground feature.
- Let the user see the foreground value before presenting an Always rationale.
- Request background permission when the user explicitly enables background tracking or geofencing.
- If the OS keeps When In Use or the user denies the upgrade, wait for app resume, recheck state, and offer a user-chosen settings path. Do not loop.
Continue to Background permissions for the API flow.
Platform boundary and verification
iOS does not provide Android-style Headless JS. Native code can retain events while JavaScript is unavailable, and the app can drain them after initialization. Background execution remains subject to iOS policy; a killed app is not an unbounded tracking guarantee.
Run yarn nitro-geolocation doctor, then verify When In Use, Always upgrade,
reduced accuracy, denial, app suspension, stored-event recovery, and any motion
flow on real devices. Before shipping, review the
reliability contract and
privacy checklist.
