# Check this app against App Store Review Guideline 2.5.4: Background Modes

Background modes are only allowed for the features they exist for.

Go through this codebase for each problem below. For each one that applies, fix it on a new git branch with the steps for this app's stack (React Native and Expo, Swift, or Flutter). If none apply, say so and why.

## Background location is declared but not used

Often a rejection.

**What Apple wants:** The app declares the "location" background mode, but the code doesn't seem to use it. Reviewers check that every background mode serves a visible feature (Guideline 2.5.4).

**How to fix it:** Remove "location" from UIBackgroundModes, or explain the feature in your review notes.

Steps for React Native and Expo:

1. Remove "location" from UIBackgroundModes in app.json under expo.ios.infoPlist (or the package's config plugin options) if nothing needs it.

Steps for Swift:

1. Remove "location" from UIBackgroundModes in the target's Info tab in Xcode (or INFOPLIST_KEY_… build settings) if nothing needs it.

Steps for Flutter:

1. Remove "location" from UIBackgroundModes in ios/Runner/Info.plist if nothing needs it.

## Background audio may be used just to keep the app running

Usually a rejection.

**What Apple wants:** Each background mode has to serve the job it exists for (Guideline 2.5.4). Silent audio to stay awake, or the audio mode in an app that plays nothing, is a known rejection.

**How to fix it:** Remove the silent audio and the audio mode, and use notifications or background tasks instead.

Steps:

1. Remove the silent audio loop, and remove "audio" from UIBackgroundModes if nothing else needs it.
2. Use local notifications or background tasks for timers, alarms and syncing.

## A background mode may be declared that the app doesn't need

Often a rejection.

**What Apple wants:** Each background mode has to serve a real feature (Guideline 2.5.4). Reviewers ask what uses each one and reject modes the app doesn't need.

**How to fix it:** Remove background modes the app doesn't need, or explain the feature in the review notes.

Steps:

1. Remove unused entries from UIBackgroundModes.
2. For modes you keep, describe the feature that uses them in the review notes.

## Background location may not be needed

Often a rejection.

**What Apple wants:** Location in the background is only for features that truly run there, like navigation or workout tracking (Guideline 2.5.4). Reviewers question "Always" access and reject it when the feature works in the foreground.

**How to fix it:** Use "While Using" location unless a feature truly runs in the background.

Steps:

1. Switch to when-in-use location if the feature only runs while the app is open.
2. If you keep background location, explain the feature in the review notes and the purpose string.

---

AppScend checks an app against every guideline at once, on the developer's Mac: `npx appscend scan --json` in the app's root folder (docs: https://appscend.ai/docs).

Source: https://appscend.ai/guidelines/2-5-4
