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

前端 未结 6 1416
暖寄归人
暖寄归人 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:49

    Here are a couple of places you can use to verify that .well-known/assetlinks.json is accessible, which is an important prerequisite for removing the disambiguation dialog.

    https://developers.google.com/digital-asset-links/tools/generator

    https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://YOUR_WEBSITE&relation=delegate_permission/common.handle_all_urls

    As for my case, despite everything checks, the disambiguation dialog just wouldn't go away. It turned out that I was also using FirebaseUI Auth for GitHub (https://github.com/firebase/FirebaseUI-Android/tree/master/auth), which uses firebase_web_host; if it's defined something other than the value defined in android:host, then android:autoVerify also fails as well.

    The problem was, firebase_web_host was buried somewhere outside of my code, so it wasn't exactly obvious why android:autoVerify was failing. One easy way to find out is to check adb log when installing the app; you should see something like

    IntentFilterIntentSvc: Verification .. complete. Success:true. Failed hosts:.
    

    If you see Success:false, it should show which hosts failed, so that should give you a clue on where to look.

提交回复
热议问题