uniapp獲取manifest.json的信息到頁面呈現!比如獲取當前版本號呈現到升級頁!應用介紹等信息
獲取方式:
// #ifdef APP-PLUS //限安卓編譯
that=this;
plus.runtime.getProperty(plus.runtime.appid, function(wgtInfo) {
that.version = wgtInfo.version; //例子:獲取版本號
console.log("launchLoadedTime: " + plus.runtime.launchLoadedTime);
console.log("launcher: " + plus.runtime.launcher);
console.log("appId: " + wgtInfo.appid);
console.log("version: " + wgtInfo.version);
console.log("code: " + wgtInfo.version.code);
console.log("innerVersion:" + plus.runtime.innerVersion);
console.log("name: " + wgtInfo.name);
console.log("description: " + wgtInfo.description);
console.log("author: " + wgtInfo.author);
console.log("license: " + wgtInfo.license);
console.log("licensehref: " + wgtInfo.licensehref);
console.log("features: " + wgtInfo.features);
});
// #endif
參考
1、如何獲取manifest.json里面version的code - DCloud問答
https://ask.dcloud.net.cn/question/15611
2、manifest.json文檔說明 - DCloud問答
https://ask.dcloud.net.cn/article/94