Android深层链接架构:匹配http和https

asc*_*sco 16 android deep-linking android-manifest

我想要我的应用程序打开http://www.example.comhttps://www.example.com.

这有效:

            <data
                android:host="www.example.com"
                android:path="/"
                android:scheme="http"/>

            <data
                android:host="www.example.com"
                android:path="/"
                android:scheme="https"/>
Run Code Online (Sandbox Code Playgroud)

是否有可能同时捕获两个条目?我试过了:

            <data
                android:host="www.example.com"
                android:path="/"
                android:scheme="http*"/>
Run Code Online (Sandbox Code Playgroud)

但这只捕获http链接,而不是https链接.

所以我知道如何处理机器人变体,但希望尽可能使用最简洁的书写.

Muz*_*ant 18

这似乎对我有用:

<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:scheme="http" />
    <data android:scheme="https" />
    <data android:host="www.mywebsite.com" />
    <data android:pathPrefix="/mypage.php" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)