Skip to main content

bn.getSystemInfoSync

getSystemInfoSync(): SystemInfo

description The api to get app info synchronously

example

try {  const res = bn.getSystemInfoSync()  console.log(res)} catch (error) {  // From the something when catch error}

Returns

SystemInfo

SystemInfo


SystemInfo#

Ƭ SystemInfo: Object

Type declaration

NameTypeDescription
brandstringEquipment brand
modelstringDevice model. New models will show unknown for a while, BN will adapt as soon as possible.
devicePixelRationumberDevice pixel ratio
pixelRationumberScreen width, in px
screenWidthnumberScreen width, in px
screenHeightnumberScreen height, in px
windowWidthnumberAvailable window width, unit px
windowHeightnumberAvailable window height, in px
statusBarHeightnumberHeight of status bar in px
languagestringLanguage of BN settings
versionstringBN version number
SDKVersionstringThe SDK version of current MP/MG
systemstringOperating System and Version
platformstringClient platform
deviceOrientation"portrait" | "landscape"Device orientation, support portrait or landscape
safeArea{ left: number ; right: number ; top: number ; bottom: number ; width: number ; height: number }A safe area in the positive direction of the vertical screen
safeArea.leftnumberUpper left abscissa of security area
safeArea.rightnumberSecurity area lower right abscissa
safeArea.topnumberTop-left ordinate of security area
safeArea.bottomnumberLower right ordinate of security area
safeArea.widthnumberWidth of security area, unit logical pixels
safeArea.heightnumberHeight of Safe Area, Unit Logical Pixels
theme?ThemeThe current theme of the system, the value is light or dark, it can be obtained only when "darkmode":true is configured globally, otherwise it is undefined (does not support mini-game)
host{ appId: string }Host environment for current Mini Programs
host.appIdstringhost appid

Theme#

Ƭ Theme: "light" | "dark"