我在创建 apple-app-site-association 文件时遇到了一些问题。我不知道如何创建没有 json extentsion 的 json 文件,并且同一文件的内容类型为 application/json
。我想在没有任何签名的情况下使用这个文件,因为它在 IOS 9 中不需要,但我无法创建有效的 apple-app-site-association 文件。
我已经在我的应用程序上设置了所有内容,例如关联域、应用程序委托(delegate)方法、配置文件。
这是我在后端的代码:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "teamID.bundleID",
"paths": [ "*" ]
}
]
}
}
最佳答案
另一种方法是使用文件匹配来精确匹配您的文件并强制执行所需的内容类型:
将以下行添加到您的 .htaccess
文件中:
<FilesMatch "^apple-app-site-association$">
ForceType application/json
</FilesMatch>
这对我有用。
关于ios - 如何在 IOS 9 中为通用链接创建 apple-app-site-association 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34945358/