设置版本号在这里插入图片描述

获取当前应用版本信息

plus.runtime.getProperty(plus.runtime.appid,(appInfo)=>{
	// appInfo为当前应用程序的所有信息
	console.log(JSON.stringify(appInfo));
	// 获取版本名称
	console.log(appInfo.version);
	// 获取版本号
	console.log(appInfo.versionCode);
	// 获取当前应用id
	console.log(appInfo.appid);
});
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐