ios - 通用链接 - 该域存在一些验证问题

标签 ios https deep-linking ios-universal-links

我正在处理通用链接以在点击 url 时打开应用程序。我正在使用 https 服务器并完成了苹果 (Apple Doc) 的所有步骤。但是苹果通用链接验证器显示以下错误,

Your file's 'content-type' header was not found or was not recognized.

enter image description here

apple-app-site-association文件成功上传到服务器,文件如下,

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "J2HBF9A3PZ.com.aors.speaku",
                "paths": ["*","/"]
            }
        ]   
    }
}

而且apple表示无论域名是否有https,都不需要签署apple-app-site-association文件。

If the file is unsigned, it should have a Content-Type of application/json. Otherwise, it should be application/pkcs7-mime.

所以我的问题是如何在这个 apple-app-site-association 文件中提及内容类型 (application/json)???

请帮我解决这个问题。我不知道这到底是什么意思。

最佳答案

我刚刚自己解决了这个问题。我必须登录到我的服务器并转到 apple-app-site-association 文件所在的目录。在这个目录中,我有一个 .htaccess 文件,我对其进行了修改以包含以下几行:

<Files "apple-app-site-association">
ForceType 'application/json'
</Files>

这样做之后,验证服务停止提示 Content-Type

注意事项:

  • 如果您没有.htaccess 文件,您可以创建一个。
  • 我假设 .htaccess 文件应该在您站点目录的根目录中(这是您最有可能放置您的 apple-app-site-association 的地方文件。

关于ios - 通用链接 - 该域存在一些验证问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39115167/

相关文章:

ios - 我的 iOS 应用仅在 "test on device"时收到来自 firebase 的推送通知

Java HTTPS 代理/重定向服务器

c# - 如何下载 HTTPS 网页的内容?

ionic-framework - 如何从 Ionic 5 中的推送通知打开应用程序 + 特定网址?

ios - 您可以从 Squarespace 托管网站深度链接到应用程序吗?

ios - cocos2d无限循环游戏的差距

iphone - 从 MVC (iOS) 中的异步操作返回结果

deep-linking - 如何离线生成 Branch.io 深层链接?

ios - 如何将默认 iOS 元素解析为特定特征?

ruby-on-rails - 闪光[:notice] not working when redirect_to changes from http to https and vice versa