There is no new version automatically detects and automatically update

 

 

// Check whether there is a new version 
    wx.getUpdateManager () onCheckForUpdate (. Function (RES) {
       // Callback Ends new version information request 
      // the console.log ( "if a new version:" + res.hasUpdate); 
      IF ( res.hasUpdate) { // If a new version 
        // applet new version will automatically trigger the download operation (no need to trigger developer) 
        wx.getUpdateManager (). onUpdateReady ( function () { // when a new version of the download is complete, We will callback 
          // new version has been downloaded well, calling applyUpdate new version of the application and restart 
          wx.getUpdateManager () applyUpdate ();. 
        }) 
      } 
    });

 

Guess you like

Origin www.cnblogs.com/XUYIYUAN/p/11297991.html