Android应用程序通过电子邮件中发送的链接打开
我们的用户会不时收到电子邮件,例如更改密码。当他们点击链接时,我想把他们发送到我们的网站,但是我们的Android应用程序被打开了 例如,链接是Android应用程序通过电子邮件中发送的链接打开,android,deep-linking,Android,Deep Linking,我们的用户会不时收到电子邮件,例如更改密码。当他们点击链接时,我想把他们发送到我们的网站,但是我们的Android应用程序被打开了 例如,链接是https://www.ourdomain.com/change-password/{random string} 我们的应用程序中确实启用了深度链接,但它们的配置方式如下: <intent-filter android:label="..."> <action android:name=
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>
因此,更改密码
部分不适合任何配置,但我们的应用程序被打开的原因可能是什么
编辑
似乎问题出在第一个
数据
-标记上;如果我将其注释掉,则其行为与预期一致(即https://www.ourdomain.com/change-password/1234
不由应用程序处理)。我不知道为什么ascustomhost
与www.ourdomain.com
..是一个完全不同的词,你可以尝试将它分成不同的
组件,因为一个
应用程序可能会混淆,即使它写得正确
<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="www.ourdomain.com"
android:pathPrefix="/somethingelse"
android:scheme="https" />
<data android:host="www.ourdomain.com"
android:pathPrefix="/againsomethingelse"
android:scheme="https" />
</intent-filter>
<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" />
</intent-filter>
<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="someothercustomhost"
android:scheme="https" />
</intent-filter>
<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="andagainacustomhost"
android:scheme="https" />
</intent-filter>
您似乎在发布之前更改了链接。这让人有点困惑。但这似乎是对的。应用程序不应打开此链接。你能再核对一下你的问题吗?您是否正确发布链接?是www.ourdomain.com
是一个德国url,customhost
-内容与url完全不同,更改密码
-事情是1:1对的。是否有其他原因/配置导致应用程序侦听该域?重复:使用answer进行测试,结果有效。