getSystemInfo(params: Object)
版本要求:
BaseKit≥2.0.1@ray-js/ray≥0.3.23
支持平台:
iOSAndroid
描述
获取系统信息
参数
| 属性 | 类型 | 必填 | 说明 |
|---|---|---|---|
complete | () => void | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
success | (params: Object) => void | 否 | 接口调用成功的回调函数 |
fail | (params: Object) => void | 否 | 接口调用失败的回调函数 |
success 回调参数
| 属性 | 类型 | 说明 | BaseKit 最低版本 |
|---|---|---|---|
is24Hour | boolean | 是否为 24 小时制 | v3.2.6 |
system | string | 操作系统及版本 | v3.2.6 |
brand | string | 设备品牌 | v3.2.6 |
model | string | 设备型号 | v3.2.6 |
platform | string | 系统类型,如 ios、android、harmony | v3.2.6 |
timezoneId | string | 时区标识 | v3.2.6 |
pixelRatio | number | 像素比 | v3.2.6 |
screenWidth | number | 屏幕宽度,单位为逻辑像素,例如返回 411 | v3.2.6 |
screenHeight | number | 屏幕高度,单位为逻辑像素,例如返回 914 | v3.2.6 |
windowWidth | number | 窗口宽度,单位为逻辑像素,例如返回 411 | v3.2.6 |
windowHeight | number | 窗口高度,单位为逻辑像素,例如返回 914 | v3.2.6 |
useableWindowWidth | number | 可使用窗口宽度,单位为逻辑像素,例如返回 411 | v3.3.2 |
useableWindowHeight | number | 可使用窗口高度,单位为逻辑像素,例如返回 814 | v3.3.2 |
statusBarHeight | number | 状态栏高度,单位为逻辑像素,例如返回 34 | v3.2.6 |
language | string | 当前语言 | v3.2.6 |
| 安全区域信息,字段单位为逻辑像素,例如返回 { left: 0, right: 411, top: 34, bottom: 898, width: 411, height: 864 } | v3.2.6 | ||
albumAuthorized | boolean | 是否允许访问相册 | v3.2.6 |
cameraAuthorized | boolean | 是否允许访问摄像头 | v3.2.6 |
locationAuthorized | boolean | 是否允许访问定位 | v3.2.6 |
microphoneAuthorized | boolean | 是否允许访问麦克风 | v3.2.6 |
notificationAuthorized | boolean | 是否允许发送通知 | v3.2.6 |
notificationAlertAuthorized | boolean | 是否允许通知提醒 | v3.2.6 |
notificationBadgeAuthorized | boolean | 是否允许通知角标 | v3.2.6 |
notificationSoundAuthorized | boolean | 是否允许通知声音 | v3.2.6 |
bluetoothEnabled | boolean | 蓝牙开关是否开启 | v3.2.6 |
locationEnabled | boolean | 定位开关是否开启 | v3.2.6 |
wifiEnabled | boolean | Wi-Fi 开关是否开启 | v3.2.6 |
theme | "dark" | "light" | 当前主题 | v3.2.6 |
deviceOrientation | "portrait" | "landscape" | 当前屏幕方向 | v3.2.6 |
deviceLevel | string | 设备等级(低:low-中:middle-高:high) | v3.3.3 |
isSupportPinShortcut | boolean | 手机系统是否支持创建快捷方式(仅Android使用) | v3.5.0 |
deviceType | string | 设备类型 phone:手机 pad:平板 | v3.10.6 |
fail 回调参数
| 属性 | 类型 | 说明 |
|---|---|---|
errorMsg | string | 错误信息 |
errorCode | string | number | 错误码 |
| 错误扩展 |
返回值
无
合法值
success.params.theme
| 值 | 说明 | BaseKit 最低版本 |
|---|---|---|
dark | 暗黑模式 | - |
light | 亮色模式 | - |
success.params.deviceOrientation
| 值 | 说明 | BaseKit 最低版本 |
|---|---|---|
portrait | 竖屏 | - |
landscape | 横屏 | - |