首页 > 解决方案 > 深层链接仅适用于 GMAIL 应用程序

问题描述

只有在从 Gmail 打开时才能识别深层链接。如果我尝试从 WhatsApp 打开,Messenger 它无法识别这些链接。为什么?

<activity android:name=".main.MainActivity"
        android:configChanges="orientation|screenSize|keyboardHidden"
        android:launchMode="singleTask"
        android:parentActivityName=".main.MainActivity">

        <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:scheme="http"
                android:host="*.www.com"
                android:pathPrefix="/x" />
            <data android:scheme="https"
                android:host="www.com"
                android:pathPrefix="/x" />
        </intent-filter>
        <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:scheme="http"
                android:host="*.www.com"
                android:pathPrefix="/y" />
            <data android:scheme="https"
                android:host="www.com"
                android:pathPrefix="/y" />
        </intent-filter>
</activity>

更新:

我调试了我的代码并发现,当我点击 gmail 中的链接时,我确实有一个类别类型(我稍后会验证它),但是如果我从 slack 或 messenger 打开链接,它是空的。这背后的原因是什么?

标签: androiddeep-linking

解决方案


推荐阅读