How to fall back to marketplace when Android custom URL scheme not handled?

后端 未结 7 488
無奈伤痛
無奈伤痛 2020-12-07 09:47

We have an app that handles a custom URL scheme (vstream://). When someone comes to a web page that has some vstream:// content, we need to redirect them to the store if th

相关标签:
7条回答
  • 2020-12-07 10:15

    For some reasons, the final solution does not work for me on android (Is it just me?!!). The key is that iframe.onload function is NOT executed when your app is installed, and it IS executed when your app is NOT installed.

    The solution becomes a little simpler actually. Here is the segment for "Older Android Browser" part:

        } else {
    
            // Older Android browser
            var iframe = document.createElement("iframe");
            iframe.style.border = "none";
            iframe.style.width = "1px";
            iframe.style.height = "1px";
            iframe.onload = function () { window.location = MARKET; };
            iframe.src = URL;
            document.body.appendChild(iframe);
    
        }
    
    0 讨论(0)
提交回复
热议问题