Skip to content

Commit 47dcfd4

Browse files
mahdidavoodi7claude
andcommitted
docs: SEO pass — keyword-led title, Overview, FAQ, related resources
Mirrors the structure used in expo-thinking-orbs: a descriptive H1, an Overview naming the wrapped platform APIs, an FAQ answering the questions people actually search for, and outbound links with real anchor text. Also expands the npm keywords from 3 to 24. Every FAQ answer is one this repo can substantiate — the Simulator limitation, the undocumented duration, the swipe-away behaviour, the expired-vs-user-cancelled asymmetry, the Android 13 permission. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent a3f639e commit 47dcfd4

2 files changed

Lines changed: 61 additions & 6 deletions

File tree

‎README.md‎

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# react-native-continued-task
1+
# react-native-continued-task: Continued Background Tasks for React Native (iOS 26 & Android)
22

33
[![npm](https://img.shields.io/npm/v/react-native-continued-task.svg)](https://www.npmjs.com/package/react-native-continued-task)
44
[![npm downloads](https://img.shields.io/npm/dm/react-native-continued-task.svg)](https://www.npmjs.com/package/react-native-continued-task)
@@ -8,6 +8,12 @@
88

99
Run user-initiated work that keeps going after the user leaves your app — a large export, an upload, a batch encode — behind one cross-platform API.
1010

11+
## Overview
12+
13+
**react-native-continued-task** is a React Native and Expo library for **long-running background tasks that survive the app being backgrounded**. It wraps iOS 26's [`BGContinuedProcessingTask`](https://developer.apple.com/documentation/backgroundtasks/bgcontinuedprocessingtask) and Android's [WorkManager](https://developer.android.com/topic/libraries/architecture/workmanager) foreground services behind a single typed API, so an upload, export, or batch encode the user started keeps running — with the progress UI each platform draws for it.
14+
15+
It is built on [Nitro Modules](https://nitro.margelo.com) with Swift on iOS and Kotlin on Android, ships an Expo config plugin, and is written for the constraints these APIs actually impose rather than hiding them.
16+
1117
<table>
1218
<tr>
1319
<td align="center"><b>iOS 26</b> — Live Activity on the Lock Screen</td>
@@ -441,6 +447,43 @@ device, an Android 15 or 16 handset that can actually reach the six-hour `dataSy
441447
`STOP_REASON_QUOTA` seen in the wild. See [CONTRIBUTING.md](CONTRIBUTING.md) for the dev loop, and
442448
[docs/DEVICE-QA.md](docs/DEVICE-QA.md) if you want to re-run the iOS checklist and add a run log.
443449

450+
## FAQ
451+
452+
**Does it work in Expo Go?**
453+
No. Nitro modules need native code, so Expo Go can never load them. Use a development build (`npx expo prebuild` then `expo run:ios` / `run:android`).
454+
455+
**Can I test this on the iOS Simulator?**
456+
No. `BGTaskScheduler` returns `.unavailable` on the Simulator — Apple documents this in the SDK header. `isSupported` reports `false` there and every submission rejects. iOS behaviour has to be verified on a physical device running iOS 26+; see [docs/DEVICE-QA.md](docs/DEVICE-QA.md).
457+
458+
**How long can a continued processing task run on iOS?**
459+
Apple does not publish a maximum duration or a concurrent-task ceiling, so this library does not quote figures. The "1 refresh + 10 processing tasks" limit in `BGTaskScheduler`'s documentation is about a different task type and does not apply here.
460+
461+
**What happens when the user swipes my app out of the app switcher?**
462+
iOS cancels the task and — verbatim from Apple — "the app doesn't receive an indication of cancellation in that case." No stop listener, no expiration handler. Call [`getKnownTasks()`](#getknowntasks-promiseknowntask) on your next launch; work interrupted that way comes back with the `app-terminated` stop reason.
463+
464+
**Why does cancelling from the Live Activity report `expired` instead of `user-cancelled`?**
465+
Because iOS routes user cancellation and system expiry through the same zero-argument `expirationHandler`, with nothing to distinguish them. This library reports what it can justify rather than guessing. Android _can_ tell them apart, and reports `user-cancelled`.
466+
467+
**My Android notification never appears. Is the task running?**
468+
Almost certainly yes. On Android 13+ you must request `POST_NOTIFICATIONS` at runtime — without the grant the foreground service still starts and the work still runs, but the notification is suppressed. See [Android 13+ needs the notification permission at runtime](#android-13-needs-the-notification-permission-at-runtime).
469+
470+
**How is this different from `expo-background-task` or `BGProcessingTask`?**
471+
Those schedule deferrable work the system runs _later_, when conditions are favourable — you do not control when, and the user sees nothing. A continued processing task starts **immediately**, because the user just asked for it, and the system shows them progress they can cancel. Different tool for a different job.
472+
473+
**Do I need the background GPU entitlement?**
474+
Only for tasks submitted with `ios.requiresGPU`. Non-GPU work needs no entitlement. Note that `com.apple.developer.background-tasks.continued-processing.gpu` is valid only for paid Apple Developer Program teams — a free personal team cannot sign it.
475+
476+
**Does it work without Expo?**
477+
Yes. The Expo config plugin is a convenience; the [Bare workflow](#bare-workflow) section lists the `Info.plist` and `AndroidManifest.xml` entries to add by hand.
478+
479+
## Related resources
480+
481+
- [motionary.dev](https://motionary.dev?utm_source=github&utm_medium=readme&utm_campaign=react-native-continued-task) — React Native components, animations and guides
482+
- [Apple: Finish tasks in the background (WWDC25 session 227)](https://developer.apple.com/videos/play/wwdc2025/227/) — the iOS behaviour this library wraps
483+
- [`BGContinuedProcessingTask` documentation](https://developer.apple.com/documentation/backgroundtasks/bgcontinuedprocessingtask)
484+
- [Android: long-running workers](https://developer.android.com/develop/background-work/background-tasks/persistent/how-to/long-running)
485+
- [Nitro Modules](https://nitro.margelo.com) — the native module framework this is built on
486+
444487
## Sponsor
445488

446489
Built and maintained by [**motionary.dev**](https://motionary.dev?utm_source=github&utm_medium=readme&utm_campaign=react-native-continued-task) — free, and free to use.

‎package.json‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,29 @@
5454
},
5555
"keywords": [
5656
"react-native",
57+
"expo",
5758
"ios",
5859
"android",
59-
"expo",
60-
"nitro",
61-
"nitro-modules",
62-
"background",
6360
"background-task",
61+
"background-tasks",
62+
"background-processing",
63+
"background-job",
6464
"bgcontinuedprocessingtask",
65+
"backgroundtasks",
66+
"bgtaskscheduler",
6567
"workmanager",
6668
"foreground-service",
67-
"live-activity"
69+
"live-activity",
70+
"background-upload",
71+
"background-export",
72+
"long-running-task",
73+
"nitro-modules",
74+
"nitro",
75+
"expo-config-plugin",
76+
"react-native-library",
77+
"swift",
78+
"kotlin",
79+
"ios26"
6880
],
6981
"repository": {
7082
"type": "git",

0 commit comments

Comments
 (0)