首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安卓应用程序不使用AppLinks打开

安卓应用程序不使用AppLinks打开
EN

Stack Overflow用户
提问于 2015-08-06 05:00:35
回答 2查看 318关注 0票数 2

我正在以applinks.org中介绍的方式将元属性添加到我的页面中,但是我的应用程序没有响应web url,这里是html的源代码:

代码语言:javascript
复制
<html>
<head>
    <meta property="al:android:url" content="applink://url" />
    <meta property="al:android:package" content="com.applink.sample" />
    <meta property="al:android:app_name" content="Sample" />
</head>
<body>
Hello!!
</body>
</html>

这是我的意图过滤器:

代码语言:javascript
复制
<activity
            android:name=".play.StartAppLinkActivity">
            <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="applink"
                    android:host="url"/>
            </intent-filter>
        </activity>
EN

回答 2

Stack Overflow用户

发布于 2015-08-06 05:06:26

<category android:name="ANDROID.INTENT.CATEGORY.BROWSABLE"/>应改为<category android:name="android.intent.category.BROWSABLE"/>。清单区分大小写。

票数 0
EN

Stack Overflow用户

发布于 2016-02-22 08:27:24

请按以下方式更改al:android:url内容

代码语言:javascript
复制
<html>
<head>
    <meta property="al:android:url" content="http://applink/url" />
    <meta property="al:android:package" content="com.applink.sample" />
    <meta property="al:android:app_name" content="Sample" />
</head>
<body>
    Hello!!
</body>
</html>

在清单中这样做

代码语言:javascript
复制
<activity android:name=".play.StartAppLinkActivity">
    <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" android:host="applink" android:path="/url"/>
        <data android:scheme="https" android:host="applink" android:path="/url"/>
    </intent-filter>
</activity>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31847160

复制
相关文章

相似问题

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