以Promise风格调用: 不支持
监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调
function callback
App({ onLaunch() { // 此处仅为效果展示,建议在app.js中的OnLaunch()中调用 const updateManager = xhs.getUpdateManager(); updateManager.onUpdateFailed((err) => { console.log("版本更新失败原因", err); xhs.showToast({ title: "版本更新失败,请重试", icon: "none", }); }); }, });