Android deep link: App chooser is triggered for each subdomain

亡梦爱人 提交于 2019-12-08 12:10:23

问题


So I have an app with deep linking that can open links from the company website. I do this by adding an intent-filter to an Activity tag like so:

        <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:host="*.company.com"
            android:scheme="https" />
        </intent-filter>

The problem is that the website has multiple subdomains that each trigger the app chooser. (category1.company.com, category2.company.com etc)

If it were using only one domain, the app chooser would appear only once when opening the main page, the user would choose to continue in the browser "just once" and navigate the website without interruption.

With subdomains, each time the user navigates to a different subdomain he sees the app chooser and has to click "just once" again.

Is there any way to configure the app to display the app chooser only the first time you go on that domain and not for each subdomain?


回答1:


Have you try several data block in the same intent filter

   <data
        android:host="category1.company.com"
        android:scheme="https" />
   <data
        android:host="category2.company.com"
        android:scheme="https" />

....



来源:https://stackoverflow.com/questions/40783464/android-deep-link-app-chooser-is-triggered-for-each-subdomain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!