Android Deep linking: Use the same link for the app and the play store

前端 未结 4 954
醉梦人生
醉梦人生 2020-11-28 02:43

I have a website which enables the user to make a search query. The query might take some time to complete (minutes to days), and I would like to enable the user to download

4条回答
  •  暖寄归人
    2020-11-28 03:22

    This workaround might work:

    1. At the server side, create a redirect rule to google play. For example, https://www.foo.com/bar/BlahBlah will redirect to https://play.google.com/store/apps/details?id=com.bar.foo&referrer=BlahBlah.

    2. At the app, register the server side link as a deep link:

    
    

    Now, if the app is installed, the URL will be caught and the path can be parsed to extract the BlahBlah part. If the app isn't installed pressing the link will redirect the user to the Play store with the referring URL.

    enter image description here

    Notes:

    • /bar/BlahBlah was converted to &referrer=BlahBlah, because the play store receives a URL argument and the deep link mechanism works with URL paths (as far a I can tell)

提交回复
热议问题