Android深层链接:每个子域都会触发应用选择器 [英] Android deep link: App chooser is triggered for each subdomain

查看:71
本文介绍了Android深层链接:每个子域都会触发应用选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我有一个具有深层链接的应用程序,可以打开公司网站上的链接。
我是通过在活动标签中添加意图过滤器来实现的,例如:

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>

问题是网站有多个子域,每个子域都会触发应用选择器。 ( category1.company.com category2.company.com 等)

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?

推荐答案

您是否曾在同一个Intent过滤器中尝试过几个数据块

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" />

....

这篇关于Android深层链接:每个子域都会触发应用选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆