简体   繁体   English

Android App无法使用AppLinks打开

[英]Android App not opening using AppLinks

I am working on adding meta properties to my page as introduce in applinks.org , however my app is not responding to the web url , here is the html source: 我正在按照applinks.org中的介绍在页面上添加元属性,但是我的应用程序未响应Web url ,这是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>

And this is the intent filter I'm having: 这是我拥有的意图过滤器:

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

<category android:name="ANDROID.INTENT.CATEGORY.BROWSABLE"/> should be changed to <category android:name="android.intent.category.BROWSABLE"/> . <category android:name="ANDROID.INTENT.CATEGORY.BROWSABLE"/>应该更改为<category android:name="android.intent.category.BROWSABLE"/> Manifest is case sensitive. 清单区分大小写。

Please do following changes in web change al:android:url content 请在网络更改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>

and in manifest do this 并在清单中这样做

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM