capacitor-doze-optimize
v0.0.3
Published
White listing an Android application programmatically from battery optimize settings
Downloads
9
Readme
capacitor-doze-optimize
White listing an Android application programmatically from battery optimize settings
Install
npm install capacitor-doze-optimize
npx cap sync
Example
import { DozeOptimize } from 'capacitor-doze-optimize';
initDozeOptimize = async () => {
// check if battery optimizations is ignoring
const isIgnoringBatteryOptimizations = await DozeOptimize.isIgnoringBatteryOptimizations();
// request battery optimizations menu and unrestrict battery optimizations for this app, add to whitelist
await DozeOptimize.requestOptimizationsMenu();
// check if data saver is ignoring
const isDataSaverOn = await DozeOptimize.isIgnoringDataSaver();
// open setting data saver menu and unrestrict data saver for this app, add to whitelist
await DozeOptimize.requestDataSaverMenu();
}
API
isIgnoringBatteryOptimizations()
requestOptimizationsMenu()
isIgnoringDataSaver()
requestDataSaverMenu()
- Interfaces
isIgnoringBatteryOptimizations()
isIgnoringBatteryOptimizations() => Promise<IsIgnoringBatteryOptimizationsResult>
Returns: Promise<IsIgnoringBatteryOptimizationsResult>
requestOptimizationsMenu()
requestOptimizationsMenu() => Promise<RequestOptimizationsMenuResult>
Returns: Promise<RequestOptimizationsMenuResult>
isIgnoringDataSaver()
isIgnoringDataSaver() => Promise<IsIgnoringDataSaverResult>
Returns: Promise<IsIgnoringDataSaverResult>
requestDataSaverMenu()
requestDataSaverMenu() => Promise<RequestDataSaverMenuResult>
Returns: Promise<RequestDataSaverMenuResult>
Interfaces
IsIgnoringBatteryOptimizationsResult
| Prop | Type |
| ---------------- | -------------------- |
| isIgnoring
| boolean |
| messages
| string |
RequestOptimizationsMenuResult
| Prop | Type |
| ----------------- | -------------------- |
| isRequested
| boolean |
| messages
| string |
IsIgnoringDataSaverResult
| Prop | Type |
| ---------------- | -------------------- |
| isIgnoring
| boolean |
| messages
| string |
RequestDataSaverMenuResult
| Prop | Type |
| ----------------- | -------------------- |
| isRequested
| boolean |
| messages
| string |