This is a sample Capacitor app designed to demonstrate the background task capabilities of the Capacitor Background Runner plugin.
The app will fetch the following data every 15 minutes (or when available depending on OS):
To demonstrate the use of background updates, these updates are performed entirely in the background.
npm install
.env.example
file to a new file called .env
and set OPENWEATHERMAP_API_KEY
equal to the value of your key.npm run build
npx cap sync
Keep in mind that iOS will ultamately decide when and how often your background task will run. Read here for more information.
Unfortunately, various Android device manufacturers have employed various aggressive battery optimization software that may interfere with or outright break the functionality of background tasks on Android. This app has been tested thoroughly with these optimizations turned OFF on the following devices: