Android深层链接无法从Gmail工作

use*_*933 5 android android-layout android-fragments

我使用从gmail到我的应用程序的深层链接。单击gmail中的深层链接后,它会在gmail webview中打开并且不支持deeplink(无法访问类似站点的错误),如果我在chrome中打开相同的网址,则工作正常。

以下是我在清单中添加的代码

 <activity android:name=".MainActivity">
        <intent-filter>
            <data
                android:host="XXXX"
                android:pathPrefix="/v1/user/reset_password/"
                android:scheme="http" />

            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
    </activity>
Run Code Online (Sandbox Code Playgroud)

请让我知道如何解决此问题。

Pra*_*pat 0

尝试这些意图过滤器

<intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <category android:name="android.intent.category.APP_BROWSER"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>

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

                <data android:scheme="file"/>
                <data android:mimeType="text/html"/>
                <data android:mimeType="text/plain"/>
                <data android:mimeType="application/xhtml+xml"/>
                <data android:mimeType="application/vnd.wap.xhtml+xml"/>
            </intent-filter>
            <intent-filter>
                <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"/>
                <data android:scheme="https"/>
                <data android:scheme="about"/>
                <data android:scheme="javascript"/>
            </intent-filter>
            <!--
                  For these schemes where any of these particular MIME types
                  have been supplied, we are a good candidate.
            -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>

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

                <data android:scheme="http"/>
                <data android:scheme="https"/>
                <data android:scheme="inline"/>
                <data android:mimeType="text/html"/>
                <data android:mimeType="text/plain"/>
                <data android:mimeType="application/xhtml+xml"/>
                <data android:mimeType="application/vnd.wap.xhtml+xml"/>
            </intent-filter>
            <!-- For viewing saved web archives. -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>

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

                <data android:scheme="http"/>
                <data android:scheme="https"/>
                <data android:scheme="file"/>
                <data android:mimeType="application/x-webarchive-xml"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.WEB_SEARCH"/>

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

                <data android:scheme="http"/>
                <data android:scheme="https"/>
            </intent-filter>
            <intent-filter>
                <action android:name="info.guardianproject.panic.action.TRIGGER"/>

                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
Run Code Online (Sandbox Code Playgroud)