Foreground Service
1
$ ionic cordova plugin add cordova-plugin-foreground-service
2
$ npm install @awesome-cordova-plugins/foreground-service
Copied!
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:
1
...
2
<platform name="android">
3
<config-file parent="/*" target="AndroidManifest.xml">
4
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
5
</config-file>
6
...
Copied!

Supported platforms

  • Android
Last modified 3mo ago