The h5 page determines whether app is installed, but after opening app, it will jump to the download page. How to solve this problem?

get down on your knees and beg the boss for help


openAPP(e) {
      var ua = window.navigator.userAgent.toLowerCase();
      console.log(ua)
      //
      if (ua.match(/MicroMessenger/i) == "micromessenger") {
        // window.location.href = "downLoadForPhone";
        
      } else {
        //
        if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
            window.location.href = "app://";
          var loadDateTime = new Date();
          window.setTimeout(function() {
            var timeOutDateTime = new Date();
            if (timeOutDateTime - loadDateTime < 5000) {
              window.location.href = ""; //ios
            } else {
              window.close();
            }
          }, 3000);
          
        } else if (navigator.userAgent.match(/android/i)) {
        window.location.href = "app://";
            window.setTimeout(function() {
              
              window.location.href = ""; //
            }, 2000)
            return


        }
      }
    }
Jul.23,2021

window.close () can only close pages opened by window.open. To close the current page using window.close, you need to use the open method:

  

ask the landlord whether he has solved the problem

Menu