# getSystemInfoSync

同步获取系统信息

# 支持说明

应用能力 Android iOS PC 预览效果
小程序 3.1.0 3.1.0 3.2.0
扫码预览
用BoosHi扫码或PC端点击
网页应用 X X X /

# 输入

# 输出

返回值为object类型,其属性与异步方法的success返回对象参数的扩展属性相同
请参考getSystemInfo

# 示例代码

try {
    let result = bz.getSystemInfoSync();
    console.log(`getSystemInfoSync success: ${JSON.stringify(result)}`);
} catch (error) {
    console.log(`getSystemInfoSync fail: ${JSON.stringify(error)}`);
}
1
2
3
4
5
6

success返回对象示例:

{
  "errMsg": "getSystemInfoSync:ok",
  "system": "11.4.0",
  "platform": "darwin",
  "appName": "BossHi",
  "version": "5.1.0",
  "language": "zh_CN",
  "SDKVersion": "1.9.56",
  "screenWidth": 1322,
  "screenHeight": 913,
  "windowWidth": 1322,
  "windowHeight": 913,
  "pixelRatio": 2,
  "statusBarHeight": 0,
  "safeArea": {
    "left": 0,
    "right": 1322,
    "top": 0,
    "bottom": 913,
    "width": 1322,
    "height": 913
  },
  "navigationBarSafeArea": {
    "left": 0,
    "right": 1268,
    "top": 0,
    "bottom": 36,
    "width": 1268,
    "height": 36
  },
  "brand": "PC",
  "model": "PC",
  "fontSizeSetting": 12
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
最后更新于 : 12/15/2022, 2:18:25 PM