bl.getSystemInfo 的同步版本
返回值
Object res
| 属性 | 类型 | 说明 | 最低版本 |
| brand | string | 手机品牌 | |
| model | string | 手机型号 | |
| pixelRatio | number | 设备像素比 | |
| devicePixelRatio | number | 设备像素比 | |
| screenWidth | number | 屏幕宽度 | |
| screenHeight | number | 屏幕高度 | |
| windowWidth | number | 可使用窗口宽度 | |
| windowHeight | number | 可使用窗口高度 | |
| statusBarHeight | number | 状态栏的高度 | |
| language | string | 系统设置的语言 | |
| version | string | APP版本号 | |
| system | string | 操作系统版本 | |
| platform | string | 客户端平台 | |
| SDKVersion | string | 客户端基础库版本 | |
| safeArea | Object | 在竖屏正方向下的安全区域 | iOS >= 3.1.0, Android >= 3.31.0 |
| benchmarkLevel | number | 设备性能等级。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) | 仅 Android >= 3.22.0 |
safeArea 的结构
| 属性 | 类型 | 说明 |
| left | number | 安全区域左上角横坐标 |
| right | number | 安全区域右下角横坐标 |
| top | number | 安全区域左上角纵坐标 |
| bottom | number | 安全区域右下角纵坐标 |
| width | number | 安全区域的宽度,单位逻辑像素 |
| height | number | 安全区域的高度,单位逻辑像素 |
示例代码
bl.getSystemInfo({
success(res) {
console.log(res.model)
console.log(res.pixelRatio)
console.log(res.windowWidth)
console.log(res.windowHeight)
console.log(res.language)
console.log(res.version)
console.log(res.platform)
}
})
try {
const res = bl.getSystemInfoSync()
console.log(res.model)
console.log(res.pixelRatio)
console.log(res.windowWidth)
console.log(res.windowHeight)
console.log(res.language)
console.log(res.version)
console.log(res.platform)
} catch (e) {
}