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