English
Get the basic information of WeChat APP
| App | H5 | 微信小程序 | 支付宝小程序 | 抖音小程序 | 快手小程序 | QQ小程序 | 百度小程序 | 京东小程序 | 钉钉小程序 | 飞书小程序 | 元服务 |
|---|---|---|---|---|---|---|---|---|---|---|---|
√ (3.4.13+) | √ (3.4.13+) | √ (2.20.1+) | x | x | x | x | x | x | x | x | x |
| HarmonyOS |
|---|
| HBuilderX 4.23 |
Return parameter description
| Parameter Name | Type | Description | Platform Difference Description |
|---|---|---|---|
| appId | string | The application appid in the manifest.json, that is, the DCloud appid. | |
| appName | string | App name in manifest.json | |
| appVersion | string | The app version name in manifest.json. | |
| appVersionCode | string | The app version name in manifest.json. | |
| appLanguage | string | Language for application settings en, zh-Hans, zh-Hant, fr, es | App, H5 |
| appWgtVersion | string | 应用资源(wgt)的版本名称。 | App 3.5.5+ |
| isUniAppX | string | 是否uni-app x | HBuilderX 4.33+ |
| uniPlatform | string | uni-app 运行平台,与条件编译平台相同 | HBuilderX 4.33+ |
| uniCompilerVersion | string | uni 编译器版本 | HBuilderX 4.33+ |
| uniRuntimeVersion | string | uni 编译器版本 | HBuilderX 4.34+ |
| hostLanguage | string | Mini Program Host Language | App only supports UNIMPSDK, H5 does not support |
| hostVersion | string | App, applet host version. For example: WeChat version number | App only supports UNIMPSDK, H5 does not support |
| hostName | string | mini program host name | App is only supported by UNIMPSDK, H5 is not supported |
| hostPackageName | string | mini program host package name | only supported by UNIMPSDK |
| hostSDKVersion | string | uni小程序SDK版本、小程序客户端基础库版本 | App 仅 UNIMPSDK 支持、H5 不支持 |
| hostTheme | string | 宿主当前主题,取值为light或dark。微信小程序全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏) | App 仅 UNIMPSDK 支持 |
| hostFontSizeSetting | string | User font size setting. The setting in "I-Settings-General-Font Size" shall prevail, unit: px | Only applet supports |
applet special return parameters
| Parameter Name | Type | Description | Platform Difference Description |
|---|---|---|---|
| SDKVersion | string | Client base library version | WeChat applet only |
| enableDebug | boolean | Whether debugging is turned on. You can enable debugging through the upper right menu or wx.setEnableDebug | WeChat applet only |
| host | Object | The current host environment where the applet is running | Only WeChat applet |
| theme | string | The current theme of the system, the value is light or dark, it can only be obtained when the global configuration "darkmode": true, otherwise it is undefined (mini games are not supported) | Only WeChat applet |
Deprecated return parameter, reserved for backward compatibility only
| Parameter Name | Type | Description | Platform Difference Description |
|---|---|---|---|
| language | string | 应用设置的语言 | H5 不支持 |
| version | string | 引擎版本号、微信版本号 |
| 类型 |
|---|
| GetAppBaseInfoResult |
|:-|:-|:-|:-|:-:|:-| |appId|string|否|-| | |appName|string|否|-| manifest.json 中应用名称。| |appVersion|string|否|-| manifest.json 中应用版本名称,如果离线打包注意修改修改index.kt中UniAppConfig类型中的版本名称文档。| |appVersionCode|string|否|-| manifest.json 中应用版本号,如果离线打包注意修改修改index.kt中UniAppConfig类型中的版本号文档。| |appLanguage|string|否|-| | |language|string|否|-| | |appWgtVersion|string|否|-| | |hostLanguage|string|否|-| | |hostVersion|string|否|-| | |hostName|string|否|-| | |hostPackageName|string|否|-| | |hostSDKVersion|string|否|-| | |hostTheme|string|否|-| | |isUniAppX|boolean|否|-| | |uniCompilerVersion|string|否|-| | |uniPlatform|string|否|-| | |uniRuntimeVersion|string|否|-| | |uniCompilerVersionCode|number|否|-| | |uniRuntimeVersionCode|number|否|-| | |packageName|string|否|-| | |bundleName|string|否|-| | |bundleId|string|否|-| | |signature|string|否|-| iOS: 应用签名证书中绑定的Bundle ID(AppleID)的md5值(全部为小写)。 | |appTheme|string|否|-| | |channel|string|否|-| | |SDKVersion|string|否|-| - | |enableDebug|boolean|否|-| - - | |fontSizeSetting|number|否|-| - 2.23.4微信字体大小,单位px | |host|GetAppBaseInfoResultHost|否|-| - | |theme|string|否|-| - light或dark,全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏)可选值: - 'dark': 深色主题; - 'light': 浅色主题; | | |