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:

Ionic 防止后台睡觉 Background Mode插件的安装(Installation)

ionic cordova plugin add cordova-plugin-background-mode npm install @ionic-native/background-mode

Ionic 防止后台睡觉 Background Mode插件支持的平台(Supported Platforms)

  • AmazonFire OS
  • Android
  • Browser
  • iOS
  • Windows

Ionic 防止后台睡觉 Background Mode插件的用法(Usage)

import { BackgroundMode } from '@ionic-native/background-mode';

constructor(private backgroundMode: BackgroundMode) { }