意图过滤器不适用于主机



这不起作用

<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:host="foosubdomain.foodomain.com"/>
</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:host="*"/>
</intent-filter>

URL必须从邮件程序打开。 URL 具有这样的结构: http://foosubdomain.foodomain.com/#object?id=e1162d22-222b-4522-2210-c222102d6022

在Qt/C++项目中使用。与Qt 5.8.0、5.9.1兼容

附言似乎出现问题是因为邮件服务器插入了重定向的信息。事实证明,我已经有另一个与标题不匹配的问题......如何根据重定向的链接过滤网址?

https://mail.mymailserver.ru/m/redirect?url=http%3A//foosubdomain.foodomain.com/%23object%3Fid%3De1162d22-222b-4522-2210-c222102d6022

IntentFilter的文档中,过滤规则进行了详细的解释。请注意:

如果指定方案但没有类型,则仅指定没有 类型(如邮件:(将匹配;内容:URI 永远不会匹配 因为它们始终具有由其内容提供的 MIME 类型 供应商。

看起来您需要提供一个"类型"过滤器。

最新更新