Android - redirect to store if app not installed (launch from website)

前端 未结 2 1532
鱼传尺愫
鱼传尺愫 2020-12-02 23:39

We have an android app that is launched when the user is redirected to a custom protocol. We want to have the user redirect to the google/play store for the app if it isn\'t

2条回答
  •  长情又很酷
    2020-12-03 00:08

    Any thoughts on how we can achieve this on android?

    Not with a "custom protocol" (or, more correctly, a "custom scheme"). The pattern on Android is for you to use a URL that you control.

    For example, the Barcode Scanner app has the following defined for its main scanning activity:

      
      
        
        
        
        
      
    

    Then, any links to http://zxing.appspot.com/scan will do one of two things:

    1. If the link is clicked from a browser on an Android device, and Barcode Scanner is installed, the user can choose between displaying the app or displaying the Web page associated with the link

    2. If the link is clicked anywhere else (Android device without the app, other mobile device, desktop, notebook, etc.), the browser brings up the Web page for that URL, in which you can do whatever you want, including optionally redirecting to the Play Store

提交回复
热议问题