单击深层链接直接启动应用程序 [英] Launching the app directly on clicking deep-link
问题描述
我在我的项目中使用 branch.io
进行深度链接。单击深层链接后,该应用不会直接启动,而是显示应用列表。然后,我需要单击我的应用程序才能将其打开。我正在Oreo(API级别27)设备上进行测试。以下是一段清单代码。
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>
推荐答案
要确保对直接打开您的应用程序:
There are a few things to ensure for a deeplink to directly open your app:
- 应用程序链接的
意向过滤器
具有autoverify选项设置为true(我认为这是在您的情况下设置的) - 您在Branch仪表板上上传的SHA-256密钥与用于签名的SHA-256密钥相同您的APK文件。 (确保您是否要针对调试版本进行测试以使用调试密钥库中的SHA-256密钥)
- 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)
如果设置正确,该应用程序链接应正确打开您的应用程序。此行为自Android API级别23及更高版本开始得到更新。
If correctly setup, the app link should correctly open your app. This behavior was updated since Android API level 23 and above.
您可以检查链接域是否正确链接到您的应用程序此处。输入详细信息并单击 Test Statement
时,应显示成功!主机<您的域>
会授予应用深度链接
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:如果您更新SHA-256密钥,则链接到<应用程序包名称>
。在Branch仪表板上,Google可能需要几个小时才能抓取Branch托管的资产链接文件。
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.
这篇关于单击深层链接直接启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!