跳到主要内容

bn.getSystemInfo

getSystemInfo(): Promise<SystemInfo>

description The api to get system info asynchronously

example

 bn.getSystemInfo({
success (res) {
console.log(res)
}
})

Returns

Promise<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)
hostHostInfoHost environment for current Mini Programs

Theme

Ƭ Theme: "light" | "dark"

HostInfo

Ƭ HostInfo: Object

Type declaration

NameTypeDescription
appIdstringhost appid
hostAppIdstringhost app id
hostAppNamestringhost app name
hostAppVersionstringhost app version
mpVersionstringmp version
routeUrlstringhost app route url