Skip to main content

获取系统信息

getSystemInfo

获取系统信息,需要是同步返回结果。

示例代码

dsBridge.call(
'getSystemInfo', {}, success (res) {
// 参照返回结果示例
}
)

返回结果示例

{
"model": "iPhone X", // 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。
"system": "iOS 10.0.1", // 系统信息
"language": "zh_CN", // APP设置的语言
"version": "1.0.0", // 版本号
"deviceOrientation": "portrait", // 设备方向
"platform": "iOS", // iOS 或 Android
"pixelRatio": 3, // 设备像素比
"devicePixelRatio": 3, // 设备像素比
"windowWidth": 375, // 可使用窗口宽度,单位px
"windowHeight": 730, // 可使用窗口高度,单位px
"screenWidth": 375, // 屏幕宽度,单位px
"screenHeight": 812, // 屏幕高度,单位px
"statusBarHeight": 44, // 状态栏的高度,单位px
"safeArea": { // 在竖屏正方向下的安全区域
"top": 44,
"left": 0,
"right": 375,
"bottom": 778,
"width": 375,
"height": 734
}
}