使用清单意图筛选器阻止应用在 URL 中特定关键字的(打开为对话框)中显示



现在在我的清单代码中,我有

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter
android:autoVerify="true"
android:label="@string/app_name" >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:scheme="http" />
<data
android:name="default-url"
android:host="@string/bc"
android:scheme="@string/bc" />
</intent-filter>

允许用户在单击以我的应用程序的域开头的 URL 时打开对话框,例如:弹出对话框以选择应用程序

并且它工作正常,但是,当用户请求忘记密码时,我遇到了一个问题,他在他的电子邮件中收到了一个链接来重置他的密码。

他收到的链接是这样的:www.domain.com/forget_password/email。

我想要的是保持应用程序链接正常工作,但如果域包含/forget_password默认情况下打开浏览器,而不是应用程序。

抱歉,<intent-filter>中没有"排除"逻辑。您不能创建一个说"我接受除此之外的一切"的<intent-filter>

您将需要处理应用程序中的forget_password路径,也许可以通过自己启动 Web 浏览器。

最新更新