tencent cloud

Feedback

Battery Level

Last updated: 2024-03-04 23:05:32

    getBatteryInfoSync

    This API is used via Object wx.getBatteryInfoSync().
    Feature Description: The synced version of wx.getBatteryInfo.
    Return Value: Object res.
    Attribute
    Type
    Description
    level
    number
    Device battery level, ranging from 1 to 100.
    isCharging
    boolean
    Whether charging in progress.

    getBatteryInfo

    This API is used via wx.getBatteryInfo(Object object).
    Feature Description: Gets the device's battery level. The synchronous API wx.getBatteryInfoSync is not available on iOS.
    Parameter and Description: Object.
    Attribute
    Type
    Default value
    Required
    Description
    success
    function
    -
    No
    Callback Function of Successful Interface Call
    fail
    function
    -
    No
    Callback Function of Failing Interface Call
    complete
    function
    -
    No
    Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
    Parameters for object.success callback function: Object res.
    Attribute
    Type
    Description
    level
    number
    Device battery level, ranging from 1 to 100.
    isCharging
    boolean
    Whether charging in progress.
    
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support