capacitor-doze-optimize
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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()

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

/capacitor-doze-optimize/

    Package Sidebar

    Install

    npm i capacitor-doze-optimize

    Weekly Downloads

    1

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    33.2 kB

    Total Files

    26

    Last publish

    Collaborators

    • asephermann