首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android Deeplink URL端点处理

Android Deeplink URL端点处理
EN

Stack Overflow用户
提问于 2021-01-15 18:19:07
回答 1查看 46关注 0票数 0

我只想在我的应用程序中打开url的特定端点,并在浏览器中休息。

我有以下url端点:

/users/sign_in -(应在应用程序中打开)-工作中

/users/password/edit -(应在应用程序中打开)-工作中

/users/ in /accept-(应在浏览器中打开)-此url可打开应用程序,但我不想为此端点打开我的应用程序

下面是我的Manifest.xml

代码语言:javascript
复制
<activity
        android:name=".activity.SetNewPasswordActivity"
        android:launchMode="singleTask">
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="test.host.com"
                android:pathPattern="/users/password/edit"
                android:scheme="https" />
        </intent-filter>
    </activity>
    <activity
        android:name=".activity.ActivitySplash"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="test.host.com"
                android:path="/users/sign_in"
                android:scheme="https" />
        </intent-filter>
    </activity>
EN

回答 1

Stack Overflow用户

发布于 2021-01-15 18:34:32

您可以通过使用pathPrefix而不是path来定位特定路径,后者会检查路径是否以上述前缀开头

代码语言:javascript
复制
<data
     android:host = "test.host.com"
     android:pathPrefix = "/users/sign_in"
     android:scheme = "https" />

<data
     android:host = "test.host.com"
     android:pathPrefix = "/users/password/edit"
     android:scheme = "https" />
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65734278

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档