当前位置:网站首页>Applet system update prompt, and force the applet to restart and use the new version
Applet system update prompt, and force the applet to restart and use the new version
2022-07-06 22:17:00 【kaka-333】
Wechat development documents api Address :UpdateManager | Wechat open documents
app.js In file
onLaunch: function () { // Start the applet to execute once
this.getNewSystem()
}
getNewSystem() {
if (wx.canIUse('getUpdateManager')){
const updateManager = wx.getUpdateManager()// Manage applet updates
updateManager.onCheckForUpdate(function (res) {
console.log(res)
if (res.hasUpdate) {//res.hasUpdate return boolean type
updateManager.onUpdateReady(function () {
wx.showModal({
title: ' Update hints ',
content: ' The new version is ready , Restart the current application ?',
success(res) {
if (res.confirm) {
// The new version has been downloaded , call applyUpdate Apply new version and restart
updateManager.applyUpdate()
}
}
})
})
// Execute when the download of the new version fails
updateManager.onUpdateFailed(function () {
wx.showModal({
title: ' Find a new version ',
content: ' Please delete the current applet , Search again and open ...',
})
})
}
})
}else{
// If the applet needs to experience in the latest wechat version , Here are some tips
wx.showModal({
title: ' Update hints ',
content: ' Current wechat version is too low , This feature is not available , Please upgrade to the latest wechat version and try again .'
})
}
},
边栏推荐
- make menuconfig出现recipe for target ‘menuconfig‘ failed错误
- 【sciter Bug篇】多行隐藏
- AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
- 中国VOCs催化剂行业研究与投资战略报告(2022版)
- Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
- Is it important to build the SEO foundation of the new website
- Bat script learning (I)
- [sdx62] wcn685x will bdwlan Bin and bdwlan Txt mutual conversion operation method
- i.mx6ull搭建boa服务器详解及其中遇到的一些问题
- GNN,请你的网络层数再深一点~
猜你喜欢
嵌入式常用计算神器EXCEL,欢迎各位推荐技巧,以保持文档持续更新,为其他人提供便利
GPS从入门到放弃(十七) 、对流层延时
LeetCode学习记录(从新手村出发之杀不出新手村)----1
功能强大的国产Api管理工具
第3章:类的加载过程(类的生命周期)详解
Management background --5, sub classification
Management background --1 Create classification
Management background --3, modify classification
GPS du début à l'abandon (XIII), surveillance autonome de l'intégrité du récepteur (raim)
Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
随机推荐
PVL EDI 项目案例
Insert sort and Hill sort
Kohana 数据库
Record the process of cleaning up mining viruses
[sciter]: encapsulate the notification bar component based on sciter
硬件開發筆記(十): 硬件開發基本流程,制作一個USB轉RS232的模塊(九):創建CH340G/MAX232封裝庫sop-16並關聯原理圖元器件
Set status bar style demo
保存和检索字符串
HDU 2008 数字统计
GPS du début à l'abandon (XIII), surveillance autonome de l'intégrité du récepteur (raim)
[Chongqing Guangdong education] Tianjin urban construction university concrete structure design principle a reference
GPS从入门到放弃(十一)、差分GPS
Powerful domestic API management tool
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
十一、服务介绍及端口
2021 geometry deep learning master Michael Bronstein long article analysis
GPS从入门到放弃(十二)、 多普勒定速
GNN, please deepen your network layer~
Solution to the problem of UOS boot prompt unlocking login password ring
【数字IC手撕代码】Verilog无毛刺时钟切换电路|题目|原理|设计|仿真