问题
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:
- The
intent-filter
for the App link has the autoverify option set to true (which I see is set in your case) - 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