mobile-background-tasks

Installation
SKILL.md

React Native Background Tasks

Quick Guide: Background tasks in React Native are heavily constrained by OS power management. Use expo-background-task (Expo) or react-native-background-fetch (bare RN) for periodic fetch. Use expo-location for background location tracking. iOS gives ~30s for refresh tasks (BGAppRefreshTask) and several minutes for processing tasks (BGProcessingTask). Android enforces 15-minute minimum intervals via WorkManager and restricts execution in Doze mode. Always call finish() or return a result when done -- the OS will terminate tasks that exceed their time budget.


<critical_requirements>

CRITICAL: Before Using This Skill

All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering, import type, named constants)

(You MUST define tasks in the top-level scope (global) -- tasks defined inside React components or lifecycle methods will NOT be registered when the app starts from the background)

(You MUST call finish(taskId) or return a BackgroundTaskResult when task execution completes -- failing to signal completion causes the OS to penalize or kill your app)

(You MUST request background permissions explicitly on both platforms -- iOS requires Info.plist UIBackgroundModes entries, Android requires manifest permissions)

(You MUST handle the OS killing your task at any time -- use expiration listeners on iOS and timeout callbacks on Android to clean up gracefully)

Installs
5
GitHub Stars
23
First Seen
Jul 25, 2026
mobile-background-tasks — agents-inc/skills