dlt.getSystemInfo
简介
dlt.getSystemInfo 是获取手机系统信息的 API。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
object.success 回调函数
参数
Object res
| 属性 | 类型 | 描述 |
|---|---|---|
| success | string | true-获取成功 |
| model | string | 手机型号 |
| pixelRatio | number | 设备像素比 |
| windowWidth | number | 窗口宽度 |
| windowHeight | number | 窗口高度 |
| language | string | 设置的语言, 遵循 ISO 639 规范。 |
| frameworkversion | string | 框架包版本号 |
| storage | string | 设备磁盘容量 |
| currentBattery | string | 当前电量百分比 |
| system | string | 系统版本 |
| platform | string | 系统名:Android,iOS / iPhone OS |
| screenWidth | number | 屏幕宽度 |
| screenHeight | number | 屏幕高度 |
| brand | string | 手机品牌 |
| packageName | string | 宿主 app 包名 |
| gaid | string | 宿主设备 ID |
| country | string | 国家 |
| mcc | string | 国家码 |
| capsuleHeight | number | 胶囊体高度。单位:px |
| capsuleWidth | number | 胶囊体宽度。单位:px |
| capsuleTranslationY | number | 胶囊体纵向偏移量。单位:px |
| capsuleTranslationX | number | 胶囊体横向偏移量。单位:px |
| statusBarHeight | number | 状态栏高度。单位:px |
示例代码
dlt.getSystemInfo({
success(res) {
console.log('success: ', res);
},
});