【问题标题】:Can android support a deeplink with an immediate '?' after the host URL?android 能否支持带有直接“?”的深层链接?在主机 URL 之后?
【发布时间】:2018-04-24 01:30:57
【问题描述】:

我们的 URL 当前具有此架构:

https://www.example.com/?dialog=login

我试过这个:

<data android:host="www.example.com" />
<data android:host="example.com" />
<data android:pathPrefix="?dialog" />
<data android:scheme="https" />
<data android:scheme="http" />

但它似乎不起作用。有什么想法吗?

【问题讨论】:

  • 尝试使用 pathPattern。
  • @xingjiu 可惜没用。

标签: android android-manifest deep-linking


【解决方案1】:
<intent-filter>
...
<data android:scheme="https" android:host="www.example.com" 
android:pathPrefix="?dialog=login" />
</intent-filter>

编辑:

路径的格式我没注意。您的网址:https://www.example.com/?dialog=login,查询字符串 [?dialog=login] 不是路径的一部分,因此 您无法过滤 在查询字符串上。

【讨论】:

  • 为您的答案添加一些解释。仅代码答案不受欢迎。
  • 以'?'开头给出一个错误:'pathPrefix 应该以 / 开始'
  • 不要指定任何android:pathPrefix(或仅将其设置为/)。字符 ? 是查询的一部分,而不是路径。
猜你喜欢
  • 1970-01-01
  • 2019-09-06
  • 1970-01-01
  • 2022-12-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-06
相关资源
最近更新 更多