Background Mode
Cordova plugin to prevent the app from going to sleep while in background. Requires Cordova plugin: cordova-plugin-background-mode. For more info about plugin, visit: https://github.com/katzer/cordova-plugin-background-mode
https://github.com/katzer/cordova-plugin-background-mode
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.
Installation#
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-plugin-background-mode $ npm install @ionic-native/background-mode $ ionic cap sync
$ ionic cordova plugin add cordova-plugin-background-mode $ npm install @ionic-native/background-mode
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us
#
Supported Platforms- AmazonFire OS
- Android
- Browser
- iOS
- Windows
#
Usage#
ReactLearn more about using Ionic Native components in React
#
Angularimport { BackgroundMode } from '@ionic-native/background-mode/ngx';
constructor(private backgroundMode: BackgroundMode) { }
...
this.backgroundMode.enable();