メインコンテンツまでスキップ
Version: v6

Power Optimization

Android Custom Roms made sometimes your apps unfunctional due to being killed in the background, notification messages do not appearing or your services being killed by agressive power saving mode. The Power Optimization plugin give you android PowerManager methods with cordova.

https://github.com/snt1017/cordova-plugin-power-optimization

Stuck on a Cordova issue?

Don't waste precious time on plugin issues.

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

$ npm install cordova-plugin-power-optimization 
$ npm install @awesome-cordova-plugins/power-optimization
$ ionic cap sync

Supported Platforms

  • Android

Usage

React

Learn more about using Ionic Native components in React

Angular

import { PowerOptimization } from '@awesome-cordova-plugins/power-optimization/ngx';

constructor(private powerOptimization: PowerOptimization) { }

...

this.powerOptimization.IsIgnoringBatteryOptimizations()
.then(onSuccess)
.catch(onError);