Skip to content

Say when the system keeps background refresh from running - #1804

Merged
robertying merged 5 commits into
mainfrom
claude/project-thread-bnwed9
Nov 23, 2026
Merged

robertying merged 5 commits into
mainfrom
claude/project-thread-bnwed9

Conversation

@robertying

Copy link
Copy Markdown
Owner

Requested by Rui · project thread

What

Settings › Notifications now says when the system doesn't let the background sync run, so new content can't be found or notified about while learnX is closed, and offers a button to the system settings that turn it back on.

Platform Reported when Button
iOS / iPadOS Background App Refresh is off for learnX or for every app (UIApplication.backgroundRefreshStatus == .denied) Turn On Background App Refresh → the app's page in Settings; the caption points to General › Background App Refresh when the global switch is the one that's off
iOS / iPadOS Screen Time or device management doesn't allow it (.restricted) None, only the caption
Android Background battery use is restricted (ActivityManager.isBackgroundRestricted), which keeps the WorkManager job from running until the app is opened Allow background usage → App info
Mac Never: there is no such setting —

Not reported:

  • Low Power Mode (iOS) pauses background refresh for every app and ends by itself, so it isn't the setting to change.
  • Battery optimization (Android), the default, still runs WorkManager jobs in Doze's maintenance windows.

The section appears only while a notification that the sync finds is on (new notices, assignments and files, grades, deadline changes, group submissions, and New Versions where it applies). Class and deadline reminders are scheduled ahead and still come. When the notification permission itself is off, that section shows first and this one waits.

How

  • modules/background: a new local Expo module, getState() → on | off | lowPower | managed, with Swift Testing and Robolectric tests. expo-background-task's getStatusAsync can't be used: on iOS it reports only whether the API exists (always unavailable on the simulator, available on a device), and on Android it always reports available.
  • services/notifications.getBackgroundRefreshState() reads it (on where the module is missing or fails), and useNotificationPermission checks it with the permissions, again each time the app comes back from the system settings.
  • New backgroundRefreshOff icon (exclamationmark.arrow.triangle.2.circlepath / sync_disabled / ArrowSyncOffRegular).
  • ota-fingerprint.json: records the new module's native code; 19.1.0 hasn't shipped, so the runtime version stays.

Generated by Claude Code

Settings › Notifications now says when the system doesn't let the
background sync run, so new content can't be notified about while learnX
is closed, and opens the system settings to turn it back on:

- iOS: Background App Refresh turned off for learnX or for every app.
  When Screen Time or device management doesn't allow it, it says so
  without a button. Low Power Mode, which pauses it for every app until
  it ends, isn't reported.
- Android: background battery use restricted for learnX, which keeps its
  WorkManager job from running until the app is opened. The default
  battery optimization still runs it, so it isn't reported.
- The Mac has no such setting.

It shows only while a notification that the sync finds is on (reminders
are scheduled ahead and still come), and after the notification
permission, which comes first. A new local module, modules/background,
reads the state, since expo-background-task's getStatusAsync reports
only whether the API exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertying
robertying merged commit ff02532 into main Nov 23, 2026
9 checks passed
@robertying
robertying deleted the claude/project-thread-bnwed9 branch November 23, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants