Skip to content

Check for manufacturer-specific opt-in battery optimization whitelists

License

Notifications You must be signed in to change notification settings

juanamd/react-native-battery-whitelist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-battery-whitelist

Checks if any manufacturer-specific opt-in battery optimization whitelist is available for the current Android device. Shows battery saving whitelist screen if this is the case.

Usage

import BatteryWhitelist from "react-native-battery-whitelist";

async function tryStartWhitelist() {
    try {
        const hasIntent = await BatteryWhitelist.hasWhitelistIntent();
        if (hasIntent) await BatteryWhitelist.startWhitelistActivity();
    } catch (error) {
        console.error(error);
    }
}

Credits

Based on https://stackoverflow.com/a/51726040/8116839

About

Check for manufacturer-specific opt-in battery optimization whitelists

Resources

License

Stars

Watchers

Forks

Packages

No packages published