# uni.getSystemInfo(options)

异步获取系统信息

# # 参数

名称 类型 必填 默认值 描述
options GetSystemInfoOptions - -

# # GetSystemInfoOptions 属性值

名称 类型 必备 默认值 描述
success (result: GetSystemInfoResult) => void null 接口调用成功的回调函数
fail (result: UniError) => void null 接口调用失败的回调函数
complete (result: any) => void null 接口调用结束的回调函数(调用成功、失败都会执行)
# # GetSystemInfoResult 属性值
名称 类型 必备 默认值 描述
SDKVersion string - 客户端基础库版本
appId string - manifest.json 中应用appid。
appLanguage string - 应用设置的语言。
appName string - manifest.json 中应用名称。
appVersion string - manifest.json 中应用版本名称(真机运行时,为基座的版本名称)。
appVersionCode number - manifest.json 中应用版本名号(真机运行时,为基座的版本号)。
brand string - 手机品牌。
browserName string - 浏览器名称。App 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空
browserVersion string - 浏览器版本、webview 版本。
deviceId string - 设备 ID
deviceBrand string - 设备品牌。如:applehuawei
deviceModel string - 设备型号
deviceType string - 设备类型。phonepadpc
devicePixelRatio number - 设备像素比
deviceOrientation string - 设备方向。如:竖屏 portrait横屏 landscape - portrait: 竖屏 - landscape: 横屏
language string - 程序设置的语言
model string - 手机型号
osName string - ios、android、windows、mac、linux
osVersion string - 操作系统版本。如 ios 版本,andriod 版本
osLanguage string - 操作系统语言
pixelRatio number - 设备像素比
platform string - 客户端平台
screenWidth number - 屏幕宽度
screenHeight number - 屏幕高度
statusBarHeight number - 状态栏的高度
system string - 操作系统版本
safeArea SafeArea - 在竖屏正方向下的安全区域
safeAreaInsets SafeAreaInsets - 在竖屏正方向下的安全区域插入位置
ua string - 用户标识。小程序端为空
uniCompileVersion string - uni 编译器版本
uniPlatform string - uni-app 运行平台。如:appmp-weixinweb
uniRuntimeVersion string - uni 运行时版本
uniCompileVersionCode number - uni 编译器版本号
uniRuntimeVersionCode number - uni 运行时版本号
version string - 引擎版本号
romName string - rom 名称。Android 部分机型获取不到值。iOS 恒为 ios
romVersion string - rom 版本号。Android 部分机型获取不到值。iOS 恒为 ios 版本号
windowWidth number - 可使用窗口宽度
windowHeight number - 可使用窗口高度
windowTop number - 可使用窗口的顶部位置
windowBottom number - 可使用窗口的底部位置
oaid string - oaid
osAndroidAPILevel number - Android 系统API库的版本。
# # SafeArea 属性值
名称 类型 必备 默认值 描述
left number - 安全区域左上角横坐标
right number - 安全区域右下角横坐标
top number - 安全区域左上角纵坐标
bottom number - 安全区域右下角纵坐标
width number - 安全区域的宽度,单位逻辑像素
height number - 安全区域的高度,单位逻辑像素
# # SafeAreaInsets 属性值
名称 类型 必备 默认值 描述
left number - 安全区域左侧插入位置
right number - 安全区域右侧插入位置
top number - 安全区顶部插入位置
bottom number - 安全区域底部插入位置
# # GetSystemInfoResult 兼容性
安卓系统版本 安卓 uni-app 安卓 uni-app-x iOS 系统版本 iOS uni-app iOS uni-app-x
oaid 4.4 x x x
osAndroidAPILevel 4.4 x x x

# # getSystemInfo 兼容性

安卓系统版本 安卓 uni-app 安卓 uni-app-x iOS 系统版本 iOS uni-app iOS uni-app-x
4.4 3.9.0 9.0 x

# # 参见

getSystemInfo

# # 通用类型

# # GeneralCallbackResult

名称 类型 必备 默认值 描述
errMsg string - 错误信息