【问题标题】:App Linking in Android Apps: Can I link ONLY the home page?Android 应用程序中的应用程序链接:我可以只链接主页吗?
【发布时间】:2018-03-22 17:56:51
【问题描述】:

这是一个有趣的问题。我似乎无法找到如何将我网站的主页链接到我的应用程序。我可以在 iOS 应用程序上执行此操作,只需在我的 AACS 文件中定义“/”,但它的 Android 模拟程序正在逃避我的搜索。这可能吗?如果有,怎么做?

【问题讨论】:

  • 在 Android 中使用 WebView
  • 我想我并不清楚问题本身,但我认为“Android 应用程序中的应用程序链接”会提示我不是在我的应用程序中寻找 WebView。

标签: android applinks


【解决方案1】:

我想通了。我最初搜索得不够好。所以,这是我遇到的问题,这是解决方案:在我的意图过滤器中,我有以下行:

        <!-- Accepts URIs that begin with https://site_base_url/deep -->
        <data android:scheme="https"
              android:host="@string/site_base_url"
              android:pathPrefix="/deep" />

我一直试图将 android:pathPrefix 更改为 "/" 显然这不起作用,但我可以将 pathPattern 定义为 "/" 以实现我的目标,而不必担心排除其他 URI路径。

        <!-- Accepts URIs that are only https://site_base_url/ -->
        <data android:scheme="https"
            android:host="@string/site_base_url"
            android:pathPattern="/" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-11-21
    • 1970-01-01
    • 2019-01-15
    • 2020-02-23
    • 2012-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多