# uni.getAppBaseInfo()

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

# getAppBaseInfo 兼容性

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|否|-|

|manifest.json 中应用appid,即DCloud appid。
| |appName|string|否|-|
|manifest.json 中应用名称。
| |appVersion|string|否|-|
|manifest.json 中应用版本名称,如果离线打包注意修改修改index.kt中UniAppConfig类型中的版本名称文档
| |appVersionCode|string|否|-|
|manifest.json 中应用版本号,如果离线打包注意修改修改index.kt中UniAppConfig类型中的版本号文档
| |appLanguage|string|否|-|
|应用设置的语言en、zh-Hans、zh-Hant、fr、es
| |language|string|否|-|
|应用设置的语言
| |appWgtVersion|string|否|-|
|应用资源(wgt)的版本名称。
| |hostLanguage|string|否|-|
|小程序宿主语言
| |hostVersion|string|否|-|
|App、小程序宿主版本。
| |hostName|string|否|-|
|小程序宿主名称
| |hostPackageName|string|否|-|
|小程序宿主包名
| |hostSDKVersion|string|否|-|
|uni小程序SDK版本、小程序客户端基础库版本
| |hostTheme|string|否|-|
|系统当前主题,取值为light或dark。微信小程序全局配置"darkmode":true时才能获取,否则为 null (不支持小游戏)
| |isUniAppX|boolean|否|-|
|是否uni-app x
| |uniCompilerVersion|string|否|-|
|uni 编译器版本
| |uniPlatform|string|否|-|
|uni-app 运行平台。
| |uniRuntimeVersion|string|否|-|
|uni 运行时版本
| |uniCompilerVersionCode|number|否|-|
|uni 编译器版本号
| |uniRuntimeVersionCode|number|否|-|
|uni 运行时版本号
| |packageName|string|否|-|
|Android的包名
| |bundleName|string|否|-|
|鸿蒙的包名
| |bundleId|string|否|-|
|iOS的bundleId
| |signature|string|否|-|
|Android: 应用签名证书的SHA1值(全部为小写,中间不包含“:”)。
iOS: 应用签名证书中绑定的Bundle ID(AppleID)的md5值(全部为小写)。
| |appTheme|string|否|-|
|当前App的主题
| |channel|string|否|-|
|当前应用分发的渠道
| |SDKVersion|string|否|-|
-
|客户端基础库版本
| |enableDebug|boolean|否|-|
-
|| |fontSizeScaleFactor|number|否|-|
-
|微信字体大小缩放比例
| |fontSizeSetting|number|否|-|
-
|需要基础库: 2.23.4

微信字体大小,单位px
| |host|GetAppBaseInfoResultHost|否|-|
-
|当前小程序运行的宿主环境
| |theme|string|否|-|
-
|系统当前主题,取值为lightdark,全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏)

可选值:
- 'dark': 深色主题;
- 'light': 浅色主题;
| |uniCompileVersionCode|number|否|-|
|uni 编译器版本号 已废弃,仅为了向下兼容保留| |uniCompileVersion|string|否|-|
|uni 编译器版本 已废弃,仅为了向下兼容保留| |version|string|否|-|
|引擎版本号。已废弃,仅为了向下兼容保留 已废弃,仅为了向下兼容保留|