bl.getDeviceBenchmarkInfo(Object object)
iOS 和 Android App 9.19.0 起支持,低版本需做兼容处理。
获取设备性能得分和机型档位数据。
仅支持回调方式调用,不支持 Promise 风格调用。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 | |
| complete | function | 否 | 接口调用结束的回调函数,成功或失败都会执行 |
object.success 回调参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| benchmarkLevel | number | 设备性能等级。-1 表示性能未知,>= 1 表示设备性能值,值越高性能越好。设备的性能值不会随时间变化,移动设备目前最高不超过 50。 |
| modelLevel | number | 设备机型档位:0 为未知,1 为高档机,2 为中档机,3 为低档机。机型档位会随时间变化,依赖该字段制定策略时需考虑档位变化。 |
示例代码
bl.getDeviceBenchmarkInfo({
success (res) {
console.log(res.benchmarkLevel)
console.log(res.modelLevel)
}
})