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

后端 未结 7 504
無奈伤痛
無奈伤痛 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:14

    UPDATE: Google broke this. See the new accepted answer instead.

    The key, it turns out, is the document.webkitHidden property. When you set window.location to a custom URL scheme and it opens, the browser keeps running, but that property goes to false. So you can test it to determine whether the custom URL scheme was handled.

    Here's a sample, which you can view live

    
      
        
        Starting App...
    
      
      
      
    
    

提交回复
热议问题