Resolves with whether this battery API is available on the current device. The value of this property is true on Android and physical iOS devices and false on iOS simulators. On web, it depends on whether the browser supports the web battery API.
Gets the battery level of the device as a number between 0 and 1, inclusive. If the device does not support retrieving the battery level, this method returns -1. On web, this method always returns -1.
A Promise that resolves to a number between 0 and 1 representing the battery level, or -1 if the device does not provide it.
Tells the battery's current state. On web, this always returns BatteryState.UNKNOWN.
Returns a Promise that resolves to a Battery.BatteryState enum value for whether the device is any of the four states.
Gets the current status of Low Power mode on iOS and Power Saver mode on Android. If a platform doesn't support Low Power mode reporting (like web, older Android devices), the reported low-power state is always false, even if the device is actually in low-power mode.
Returns a Promise that resolves to a boolean value of either true or false, indicating whether low power mode is enabled or disabled, respectively.
Low Power Mode (iOS) or Power Saver Mode (Android) are enabled.
Gets the power state of the device including the battery level, whether it is plugged in, and if the system is currently operating in Low Power Mode (iOS) or Power Saver Mode (Android). This method re-throws any errors that occur when retrieving any of the power-state information.
Returns a promise with an object with the following fields:
batteryLevel (float) -- a number between 0 and 1, inclusive, or -1 if the battery level is unknown