The utilization method for this API is Object wx.getBatteryInfoSync().
Attributes | Types | Note |
level | number | Device battery level, ranging from 1 - 100. |
isCharging | boolean | Is the device currently charging? |
The method for utilizing this API is wx.getBatteryInfo(Object object).
Attributes | Types | Default value | Required | Note |
success | function | - | Not required | Callback function for successful interface invocation |
fail | function | - | Not required | Callback function for unsuccessful interface invocation |
complete | function | - | Not required | Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations) |
Attributes | Types | Note |
level | number | Device battery level, ranging from 1 - 100. |
isCharging | boolean | Is the device currently charging? |
Was this page helpful?