问题
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