首页 > 解决方案 > 如何触发深度链接?

问题描述

在我的应用中,我启用了深层链接,例如:

<activity android:name="com.example.android.DeepLinkActivity">
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:host="www.bartsimposon.net" android:scheme="https"/>
        <data android:pathPattern="/kwitchiboo/.*\\.html"/>
    </intent-filter>
</activity>

当我进入智能手机浏览器时,我期待

https://www.bartsimpson.net\kwitchiboo\something.html

触发我的DeepLinkActivity

标签: androidandroid-manifestandroid-deep-link

解决方案


您必须单击此链接,而不是在某些浏览器的地址字段/多功能框中手动输入。在您的手机上导航到此站点/主题并尝试单击此处:

https://www.bartsimpson.net/kwitchiboo/something.html

在您的应用程序安装和第一次此类链接点击系统会询问您要在哪个应用程序中打开 URL、浏览器或您的应用程序。还有“总是”和“只有一次”选项


推荐阅读