wx.getBatteryInfo(Object object)
Obtains the device's battery level. The synchronous API wx.getBatteryInfoSync is not available on iOS.
Parameters
Object object
| Attribute | Type | Default | Required | Description |
| success | function | | No | The callback function for a successful API call |
| fail | function | | No | Callback function for failed API call |
| complete | function | | No | Callback function used when API call completed (always executed whether call succeeds or fails) |
object.success callback function
Parameters
Object res
| Property | Type | Description |
| level | string | The device's battery level. Range: 1-100. |
| isCharging | boolean | Indicates whether the device is charging. |