Taro.getBatteryInfoSync()
The synchronous version of Taro.getBatteryInfo
.
Type
() => Result
Parameters
Result
Property | Type | Description |
---|---|---|
isCharging | boolean | Indicates whether the device is charging. |
level | string | The device's battery level. Range: 1-100. |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.getBatteryInfoSync | ✔️ |