相关疑难解决方法(0)

使用path,pathPrefix或pathPattern的Intent过滤器

我的测试uri字符串是

http://test.host.com/path/test.html?key1=val1&key2=val2

我在清单中制作了意图过滤器

A.计划和主持人(它有效,但我不想)

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <data
        android:scheme="http"
        android:host="test.host.com"
    />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

B. A&path(pathPrefix,pathPattern)(不起作用)

    <data
        android:scheme="http"
        android:host="test.host.com"

        1. android:path="path/test.html" -> not worked (link to chrome broswer)
        2. android:path="path"           -> not worked (link to chrome broswer)
        3. android:pathPrefix="path"     -> not worked (link to chrome broswer)
        4. android:pathPattern="user/invite.*"  -> same (I do not know pattern)

    />
Run Code Online (Sandbox Code Playgroud)

我想开始我的应用程序时(路径/ test.html中)

android uri intentfilter android-intent

12
推荐指数
3
解决办法
2万
查看次数

如何使用 PathPattern 来创建 DeepLink Apps Android?

我已阅读有关在 android studio 3.0 中创建深层链接和使用应用链接服务的文档。它非常简单且易于理解,但是当我的 URL 没有前缀路径时,我会遇到一些问题。例子 :

https://example.com/ / AMP

没有前缀,它直接是 url 模式。当我使用正则表达式时

^[a-z0-9]+(?:-[a-z0-9]+)*$

它不起作用,错误显示为

该 URL 未映射到任何活动

当我只使用星星时,例如:

https://example.com/ */amp

它的显示似乎错误。我在这一步卡住了,我检查了很多关于 deeplink 的教程,并且总是使用 pathPrefix 而不是 pathPattern。

请有人帮助我。太感谢了

android permalinks deep-linking

4
推荐指数
1
解决办法
6727
查看次数