How to open URL schemes from Safari in iOS9?

前端 未结 5 1106
离开以前
离开以前 2020-12-30 01:21

I was able to open apps from safari this way:

window.location = \'myapp://do/xx\';

or open facebook app:

window.location =          


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 02:17

    Just assign a desired address to the href property, instead of trying to replace the whole window.location object:

    window.location.href = 'myapp://do/xx';

    It works for me on iOS 9.0.2, but now safari shows a confirmation dialog to ensure а user really wants open your link in the app.

提交回复
热议问题