Argument clarification
This commit is contained in:
parent
c6eae791e7
commit
9c248c5aba
@ -102,6 +102,7 @@ components (network connection, GPS, etc.) when it is asleep for an extended per
|
|||||||
|
|
||||||
To check to see if the app that uses this plugin is on the device's battery optimization whitelist, use the following function:
|
To check to see if the app that uses this plugin is on the device's battery optimization whitelist, use the following function:
|
||||||
```js
|
```js
|
||||||
|
// 'result' is either 1 (in whitelist), or 0 (not in whitelist)
|
||||||
window.powerManagement.isIgnoringBatteryOptimizations(function(result) {
|
window.powerManagement.isIgnoringBatteryOptimizations(function(result) {
|
||||||
if (result === 1) {
|
if (result === 1) {
|
||||||
console.log('This app IS on the device\'s battery optimization whitelist.');
|
console.log('This app IS on the device\'s battery optimization whitelist.');
|
||||||
@ -116,6 +117,7 @@ window.powerManagement.isIgnoringBatteryOptimizations(function(result) {
|
|||||||
|
|
||||||
This function can be use in conjunction with the `window.powerManagement.addAppToBatteryWhitelist` above. Example:
|
This function can be use in conjunction with the `window.powerManagement.addAppToBatteryWhitelist` above. Example:
|
||||||
```js
|
```js
|
||||||
|
// 'result' is either 1 (in whitelist), or 0 (not in whitelist)
|
||||||
window.powerManagement.isIgnoringBatteryOptimizations(function(result) {
|
window.powerManagement.isIgnoringBatteryOptimizations(function(result) {
|
||||||
// If the app isn't on the battery whitelist, open the dialog to add it
|
// If the app isn't on the battery whitelist, open the dialog to add it
|
||||||
if (result !== 1) {
|
if (result !== 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user