how to prevent iOS safari alert when trying to open non-installed native app?

后端 未结 6 1942
你的背包
你的背包 2020-12-04 09:11

I\'ve been looking for a way to open a native iOS app from the browser. I found a decent solution here: Is it possible to register a http+domain-based URL Scheme for iPhone

6条回答
  •  情歌与酒
    2020-12-04 09:27

    Here is a solution that works for me:

    var timeout;
    
    function preventPopup() {
        clearTimeout(timeout);
        timeout = null;
        window.removeEventListener('pagehide', preventPopup);
    }
    
    function openApp() {    
        $('