【问题标题】:Android Instant App deep linkAndroid 免安装应用深层链接
【发布时间】:2017-09-26 06:49:55
【问题描述】:

我在功能模块中声明了以下内容。我在移动设备中测试了即时应用程序,它运行成功。但是当我输入此 URL 时,它不会导致即时应用程序。从 URL 启动即时应用程序的程序是什么。提前致谢

<data
   android:host="abc.cde.com"
   android:pathPattern="/hello"
   android:scheme="https"/>

【问题讨论】:

  • 您发布了应用程序吗?
  • 你能澄清一下“输入这个网址”是什么意思吗?如果您在浏览器的地址栏中键入它,它不应该以这种方式工作。您可以通过打开 Gmail、环聊、Google 搜索结果等应用程序的 URL 来启动已发布的即时应用程序(通过buzzfeed.com/tasty URL 启动现有的即时应用程序来尝试它)。或者您可以在浏览器中搜索“buzzfeed 美味”,您会在搜索结果中看到“Buzzfeed 应用 - 即时”,此链接将启动 Buzzfeed 即时应用。
  • 我没有发布应用程序。当我在 chrome 或浏览器中输入 url 时,我想去即时应用程序。

标签: android android-instant-apps android-8.0-oreo deeplink


【解决方案1】:

取自 Android Instant Apps code samples on GitHub

您要处理的 Activity 需要这样的意图过滤器:

<intent-filter
        android:autoVerify="true"
        android:order="1">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />

    <data android:scheme="https" />
    <data android:scheme="http" />
    <data android:host="hello.instantappsample.com" />
    <data android:pathPrefix="/hello" />
</intent-filter>

主机和路径应与您要用作此即时应用功能入口点的 URL 匹配。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-29
    • 2019-07-21
    • 2021-03-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多