【问题标题】:iOS apple-app-site-association - does it need to be off the root of my server?iOS apple-app-site-association - 它是否需要脱离我的服务器的根目录?
【发布时间】:2020-07-10 19:44:24
【问题描述】:

我正在尝试为我的 Capacitor 应用程序配置深度链接,并按照此处的说明进行操作:https://capacitorjs.com/docs/guides/deep-links。苹果提到了

“该文件需要通过 HTTPS 访问——无需任何重定向——在 https:///apple-app-site-association 或 https:///.well-known/apple-app-site-association。接下来,你 需要处理应用中的通用链接”

“将 apple-app-site-association 文件上传到您的 HTTPS Web 服务器。您可以将该文件放在服务器的根目录或 .well-known 子目录中。”

https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html


我的问题是:.well-known 目录是否绝对需要脱离我的服务器的根目录?

我们使用 Google Cloud 和 Kubernetes,我需要链接的网站不在domain.com,而是在domain.com/myapp。我需要能够在 domain.com/myapp/.well-known/apple-app-site-association 上提供 apple-site-association 文件。

但是,当我在以下位置提供关联文件时:

domain.com/myapp/.well-known/apple-app-site-association

我明白了:

"Error cannot fetch app site association" from https://search.developer.apple.com/appsearch-validation-tool"

我已经在设备上测试了与我的应用程序的深度链接(只是为了看看验证器是否错误),但总是被路由到我们的网站而不是我们的应用程序。

【问题讨论】:

    标签: ios deep-linking ios-universal-links capacitor apple-app-site-associate


    【解决方案1】:

    是的,.well-known 必须脱离根目录。它不能在/myapp 下,也不能使用重定向。

    您可以在站点关联文件中指定路径,因此您使用的通用链接可以包含/myApp 路径。

    【讨论】:

      【解决方案2】:

      我的经验是.well-known目录不能修改(其他原因)。我将apple-app-site-association 直接放在我网站的根目录下,它工作正常。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-11-06
        • 1970-01-01
        • 2020-08-28
        • 1970-01-01
        • 2017-07-11
        • 1970-01-01
        • 2020-08-21
        相关资源
        最近更新 更多