Awesome Cordova Plugins Docs

Community docs for every @awesome-cordova-plugins package — install guides, API notes and Capacitor migration paths.

foreground-service

Foreground Service plugin for Cordova and Ionic. This plugin allows for android devices to continue running services in the background, using a foreground…

latest: v9.6.0 · npm: @awesome-cordova-plugins/foreground-service

Install

npm install @awesome-cordova-plugins/foreground-service
ionic cordova plugin add cordova-plugin-foreground-service

Migrating to Capacitor?

No 1:1 official equivalent was found for this plugin. Check the Capgo community plugin directory or the official Capacitor plugin list for alternatives — many Cordova plugins also still work inside Capacitor via npx cap add.

Foreground Service

This plugin allows for android devices to continue running services in the background, using a foreground ongoing notification. This is targeted towards use with plugins such as 'cordova-geolocation' that will not run while the app is in the background on android API 26+.

For android API 28+, the following xml snippet should be inserted into config.xml:

...
<platform name="android">
  <config-file parent="/*" target="AndroidManifest.xml">
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
  </config-file>
  ...

Installation

ionic cordova plugin add cordova-plugin-foreground-service
npm install @awesome-cordova-plugins/foreground-service

Plugin Repo: https://github.com/DavidBriglio/cordova-plugin-foreground-service

Supported Platforms

Further Information