1.0.1 • Published 2 years ago
capacitor-battery-optimization v1.0.1
capacitor-battery-optimization
This plugin will allow you to direct the user to the settings were they can whitelist the app for ignoring battery optimizations, it will also allow you to check if the permisison was granted or not. This plugin avoids the need for including 'REQUEST_IGNORE_BATTERY_OPTIMIZATIONS' in the manifest.
Install
npm install capacitor-battery-optimization
npx cap sync
API
openBatteryOptimizationSettings()
openBatteryOptimizationSettings() => Promise<void>
checkBatteryOptimizationPermissions()
checkBatteryOptimizationPermissions() => Promise<{ ignoring: boolean; }>
Returns: Promise<{ ignoring: boolean; }>