js
console.log('安装文件:==========', path);
plus.nativeUI.showWaiting('安装更新文件...'); //安装更新文件...
uni.setStorageSync('ver', this.新版本号);
plus.runtime.install(
path,
{ force: true },
function() {
plus.nativeUI.closeWaiting();
// 应用资源下载完成!
plus.nativeUI.alert('应用资源下载完成!', function() {
plus.runtime.restart();
});
},
function(e) {
plus.nativeUI.closeWaiting();
// 安装更新文件失败
plus.nativeUI.alert('安装更新文件失败[' + e.code + ']:' + e.message);
}
);
1 个回复
1***@qq.com
使用这个API获取最新资源包版本号:plus.runtime.getProperty(plus.runtime.appid, (wgtInfo) => {this.version = wgtInfo.version})