lundi 29 août 2016

ios9 cannot open the page when launch the local ios app by browser

  if (isIos) {
        if (isIos9) {
                window.location = 'bdwm://';
                iosGo();
            } else {
                createIframe();
                iosGo();
         }
    }
  function createIframe() {
        var iframe = document.createElement('iframe');
        iframe.style.cssText = 'display:none;width:0;height:0';
        document.body.appendChild(iframe);
        iframe.src = 'bdwm://';
    }
  function iosGo() {
        var t = Date.now();
        setTimeout(function () {
            if (Date.now() - t < 600) {
                location.href = "http://ift.tt/RFSNFS....."//the iOS app url
            }
        }, 500);
    }

==============================================

I want to solve this question "when exists your app on your iPhone ,you can first launch the local your app,but when not exists,you must go to download the iOS app".

The above is my code. When in iOS 9.3,the app will alert the dialog"cannot open the page because the address is invalid", how can i solve it?Thanks!

enter image description here




Aucun commentaire:

Enregistrer un commentaire