【发布时间】:2017-06-11 15:36:25
【问题描述】:
我们的用户不时收到电子邮件,例如更改他们的密码。当他们点击链接时,我想让他们发送到我们的网站,但我们的 Android 应用程序被打开了。
链接例如是https://www.ourdomain.com/change-password/{random-string}。
我们的应用中确实启用了深层链接,但它们的配置方式如下:
<intent-filter android:label="...">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="customhost"
android:pathPrefix="/"
android:scheme="https" />
<data
android:host="www.ourdomain.com"
android:pathPrefix="/somethingelse"
android:scheme="https" />
<data
android:host="www.ourdomain.com"
android:pathPrefix="/againsomethingelse"
android:scheme="https" />
<data
android:host="someothercustomhost"
android:scheme="https" />
<data
android:host="andagainacustomhost"
android:scheme="https" />
</intent-filter>
所以change-password 部分不适合任何配置,但我们的应用打开的原因可能是什么?
编辑
好像问题出在第一个data-tag;如果我将其注释掉,它会按预期运行(即 https://www.ourdomain.com/change-password/1234 不是由应用程序处理的)。我不知道为什么customhost 与www.ourdomain.com 完全不同...
【问题讨论】:
-
您好像在发帖前更改了链接。这让人有点困惑。但这似乎是对的。此链接不应由应用程序打开。你能重新检查你的问题。 ?您发布的链接是否正确?
-
是的;
www.ourdomain.com是德语网址,customhost-stuff 与网址完全不同,change-password-thing 是 1:1 对的。 -
是否有其他原因/配置导致应用监听该域?
-
此重复:stackoverflow.com/questions/34276617/… 已通过答案测试并且有效。
标签: android deep-linking