Launching the app directly on clicking deep-link

て烟熏妆下的殇ゞ 提交于 2019-12-13 03:45:14

问题


I'm using branch.io in my project for deep-linking. On click of the deep-link, the app is not getting launched directly instead it's showing the list of apps. Then I need to click my app in order to open it. I'm testing on Oreo(API level 27) device. Below is a piece of manifest code.

         <intent-filter
            android:autoVerify="true"
            tools:targetApi="m">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="xxx-alternate.app.link"
                android:scheme="https" />
            <data
                android:host="xxx.test-app.link"
                android:scheme="https" />
            <data
                android:host="xxx.app.link"
                android:scheme="https" />
        </intent-filter>

回答1:


There are a few things to ensure for a deeplink to directly open your app:

  1. The intent-filter for the App link has the autoverify option set to true (which I see is set in your case)
  2. The SHA-256 key you have uploaded on the Branch dashboard is the same SHA-256 key that is used to sign your APK file. (Make sure if you are testing against a debug build to use the SHA-256 key from the debug keystore)

If correctly setup, the app link should correctly open your app. This behavior was updated since Android API level 23 and above.

You can check if the link domain is correctly linked to your application here. On entering the details and clicking Test Statement it should state "Success! Host <your domain> grants app deep linking to <App Package Name>" if correctly linked.

PS: If you update your SHA-256 key on Branch dashboard, it might take a few hours for Google to scrap the asset-link file hosted by Branch.



来源:https://stackoverflow.com/questions/48759439/launching-the-app-directly-on-clicking-deep-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!