我一直在尋找一種方法來從瀏覽器中打開本機iOS應用程序。 我在這裏找到了一個不錯的解決方案:Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?如何在嘗試打開未安裝的原生應用程序時阻止iOS Safari瀏覽器警報?
這個解決方案在安裝應用程序時效果很好。但是當用戶沒有安裝此應用程序時 - safari會觸發一條錯誤消息,指出「由於地址無效,Safari無法打開頁面」。
有沒有辦法阻止這種行爲,而是提示用戶下載應用程序?
也許這個答案可以幫助你http://stackoverflow.com/a/16720093/2291363 – zbMax
這正是我所做的,這一點:window.location的= 「APPNAME://」 ;當應用程序沒有安裝在設備上時會觸發一個醜陋的錯誤 –
它會觸發一個錯誤,但在超時重定向時它會消失 – SomeGuy