Android App无法使用AppLinks打开

时间:2015-08-06 05:00:36

标签: android applinks

我正在努力向我的页面添加元属性,如applinks.org中所述,但我的应用没有响应网址,这里是html来源:

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

这是我正在使用的意图过滤器:

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

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

请在网络更改al:android:url内容

中进行以下更改
<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>

并在清单中执行此操作

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