How to open app from a link without asking user to decide between browser or app, just open my app immediately

前端 未结 6 1422
暖寄归人
暖寄归人 2020-12-28 16:30

I have this intent-filter that I want that every time user clicks a link to eeexample.com to open my app:


    

        
6条回答
  •  没有蜡笔的小新
    2020-12-28 16:48

    Bypassing the disambiguation dialog is only possible with the Android 6.0 API for App Linking.

    Per the Handling App Links training:

    Android 6.0 (API level 23) and higher allow an app to designate itself as the default handler of a given type of link. If the user doesn't want the app to be the default handler, they can override this behavior from Settings.

    Automatic handling of links requires the cooperation of app developers and website owners. A developer must configure their app to declare associations with one or more websites, and to request that the system verify those associations. A website owner must, in turn, provide that verification by publishing a Digital Asset Links file.

    This involves creating the appropriate intent handler and enabling automatic verification by adding android:autoVerify="true":

    
    
      
        
        
        
        
        
      
    
    
    

    Then, updates must be made on the website side by declaring a website association, which ensures that the website owner and the app developer both coordinate to allow the app to autoomatically become the default for a URL scheme.

提交回复
热议问题