I've enabled deep linking on my android app and it's working fine.
However, I want the intent-filter to listen to a particular pathPrefix
only i.e. http(s)://(www.)mydomain.com/e
and not any other pathPrefix
.
Is this possible? I'm attaching my intent-filter code in AndroidManifest.xml
<intent-filter android:label="My 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="http"
android:host="www.domain.com"
android:pathPrefix="/e" />
<data android:scheme="http"
android:host="mydomain.com"
android:pathPrefix="/e" />
<data android:scheme="https"
android:host="www.mydomain.com"
android:pathPrefix="/e" />
<data android:scheme="https"
android:host="mydomain.com"
android:pathPrefix="/e" />
</intent-filter>
答案 0 :(得分:2)
使用该清单,您告诉您的设备启动包含具有
所有网址的意图过滤器的活动由于该问题与pathPrefix有关,因此您的活动将处理其路径在开头具有/ e的所有网址。例如:
答案 1 :(得分:0)
由于您粘贴的代码对pathPrefix
有好处,我猜您只想抓住http(s)://(www.)mydomain.com/e
而没有其他内容?
如果是这种情况,请使用path
代替pathPrefix
。
<intent-filter android:label="My 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="http"
android:host="www.domain.com"
android:path="/e" />
<data android:scheme="http"
android:host="mydomain.com"
android:path="/e" />
<data android:scheme="https"
android:host="www.mydomain.com"
android:path="/e" />
<data android:scheme="https"
android:host="mydomain.com"
android:path="/e" />
</intent-filter>