当前位置:网站首页>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 .'
})
}
},边栏推荐
- [sciter bug] multi line hiding
- RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
- Adjustable DC power supply based on LM317
- Codeforces Round #274 (Div. 2) –A Expression
- ZABBIX proxy server and ZABBIX SNMP monitoring
- 十二、启动流程
- 2500 common Chinese characters + 130 common Chinese and English characters
- Is it important to build the SEO foundation of the new website
- Record the process of cleaning up mining viruses
- Oracle-控制文件及日志文件的管理
猜你喜欢

bat脚本学习(一)

GPS du début à l'abandon (XIII), surveillance autonome de l'intégrité du récepteur (raim)

2020 Bioinformatics | GraphDTA: predicting drug target binding affinity with graph neural networks

make menuconfig出现recipe for target ‘menuconfig‘ failed错误

GPS从入门到放弃(十九)、精密星历(sp3格式)

Management background --3, modify classification

Oracle-控制文件及日志文件的管理

Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode

GNN,请你的网络层数再深一点~

小常识:保险中的“保全”是什么?
随机推荐
设置状态栏样式Demo
【sdx62】WCN685X将bdwlan.bin和bdwlan.txt相互转化操作方法
C#实现水晶报表绑定数据并实现打印4-条形码
Search element topic (DFS)
HDU 2008 数字统计
Codeforces Round #274 (Div. 2) –A Expression
2500个常用中文字符 + 130常用中英文字符
hdu 4912 Paths on the tree(lca+馋)
插入排序与希尔排序
Notes de développement du matériel (10): flux de base du développement du matériel, fabrication d'un module USB à RS232 (9): création de la Bibliothèque d'emballage ch340g / max232 SOP - 16 et Associa
微信红包封面小程序源码-后台独立版-带测评积分功能源码
UNI-Admin基础框架怎么关闭创建超级管理员入口?
PVL EDI 项目案例
Intelligent online customer service system source code Gofly development log - 2 Develop command line applications
基于LM317的可调直流电源
经纪xx系统节点VIP案例介绍和深入分析异常
二叉(搜索)树的最近公共祖先 ●●
MariaDb数据库管理系统的学习(一)安装示意图
Unity3d Learning Notes 6 - GPU instantiation (1)
2500 common Chinese characters + 130 common Chinese and English characters