问题描述:
UpdateManager版本更新检查这个模块使用中出现了一些问题
updateManager.onCheckForUpdate这个方法没有回调
官方文档内也没有详细的说明和示例
就想问一下是不是这个接口暂时还不支持?
如果支持的话,为什么没有回调,谢谢
报错截图、相关bug:
复现步骤:
联系方式:
代码示例:
const updateManager = tt.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
console.log("请求完新版本信息的回调", res.hasUpdate, "costTime :", Laya.timer.currTimer - timer);
if (!res.hasUpdate) {
//没有版本更新 才出现主界面
} else {
//有版本更新
}
})
updateManager.onUpdateReady(function () {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
console.log("新版本下载完毕", "costTime :", Laya.timer.currTimer - timer);
WindowManager.ShowTip(FuncTranslate.getInstance().getTranslate("#versionUpdateReady"));
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
})
