Background Mode

Contents

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

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) { }

...

this.backgroundMode.enable();