【问题标题】:Android App not opening using AppLinksAndroid 应用程序未使用 AppLinks 打开
【发布时间】:2015-08-06 05:00:35
【问题描述】:

我正在向我的页面添加元属性,如 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>

这是我的意图过滤器:

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

【问题讨论】:

  • 你从哪里点击网址?

标签: android applinks


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    请在网页更改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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 2018-06-07
      • 2022-11-11
      • 2016-09-15
      相关资源
      最近更新 更多