Android Deeplinking 不适用于多种方案 [英] Android Deeplinking not working with multiple schemes

查看:35
本文介绍了Android Deeplinking 不适用于多种方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了以下情况.我在 AndroidManifest.xml

I am stuck with the following scenario. I defined the following deep link intent filters in the AndroidManifest.xml

预期行为是当我找到格式为 http://www.domain.com/a/blabla 的 url 或格式为 domain/的 SMS/电子邮件中的链接时xyz 系统应该触发我的活动.

Expected behavior is when I found a url of format http://​www.domain.com/a/blabla or when there is link in SMS/eMail of format domain/xyz the system should trigger my activity.

案例 #1:工作正常

    <activity
        android:name=".MYActivity">
        <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:host="xyz"
                android:scheme="domain" />
        </intent-filter>
    </activity>

案例 2:工作正常

     <activity
        android:name=".MYActivity">
        <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" 
                android:host="www.domain.com"
                android:pathPrefix="/a"
             />
        </intent-filter>
    </activity>

案例 #3:不工作

    <activity
        android:name=".MYActivity">
        <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:host="xyz"
                android:scheme="domain" />
             <data
                android:scheme="http" 
                android:host="www.domain.com"
                android:pathPrefix="/a"
             />
        </intent-filter>
    </activity>

非常感谢任何建议/要点/帮助

Any suggestions/points/help is really appreciated

推荐答案

我将两个深层链接放在了两个不同的意图过滤器中,并且奏效了!!!.

I placed both the deeplinks in two different intent filters and it worked!!!.

这篇关于Android Deeplinking 不适用于多种方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆