HomeDocs
跳到主要内容

获取屏幕亮度

methodName: getScreenBrightness

额外参数:

success 回调函数

参数

Object res

属性类型描述
screenBrightnessNumber当前屏幕亮度,取值范围 0-1
successString描述接口调用成功或失败。"true": 成功;"false":失败

fail 回调函数

参数

Object res

属性类型描述
successString描述接口调用成功或失败。"true": 成功;"false":失败
errMsgString错误信息

调用示例

const dlt = window['@transsion/byteh5bridge'];
const canCallDlt = dlt && window.dltms && window.dltms.isMiniShellGame();

if (canCallDlt) {
dlt.callApi('getScreenBrightness', {
success: (res) => {
console.log('success: ', res);
},
fail: (res) => {
console.log('fail: ', res);
},
complete: (res) => {
console.log('complete: ', res);
},
});
}
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.