expo-background-fetch
Version: 55.0.6 Expo universal module for BackgroundFetch API. Allows you to register background tasks that run periodically even when the app is closed or in the background.Installation
Usage
API Reference
Methods
(taskName: string, options?: BackgroundFetchOptions) => Promise<void>
Registers a background fetch task
(taskName: string) => Promise<void>
Unregisters a background fetch task
() => Promise<BackgroundFetchStatus>
Gets background fetch status
(seconds: number) => Promise<void>
Sets minimum fetch interval (iOS only)
Types
BackgroundFetchOptions
number
Minimum interval in seconds between fetches. Default: 900 (15 min)
boolean
Whether to stop task when app is terminated. Default: true
boolean
Whether to start task on device boot (Android). Default: false
BackgroundFetchResult
Examples
Sync Data in Background
Platform Support
Configuration
app.json
Best Practices
- Battery Efficiency: Keep background tasks short
- Minimum Interval: Respect system-imposed minimum intervals
- Error Handling: Always handle errors gracefully
- Return Values: Return appropriate BackgroundFetchResult
- Testing: Test on real devices, not simulators