iOS Universal Link 配置
2023-06-20 本文已影响0人
ErHu丶
官方验证可行性:
curl -v https://app-site-association.cdn-apple.com/a/v1/your domain
apple-app-site-association 文件内容
{
"applinks": {
"details": [
{
"appIDs": [ "TeamID.BoundleID" ],
"components": [
{
"/": "/匹配的路径/*",
"comment": "注释,匹配路径下都会有“打开”提示"
}
]
}
]
}
}
cd /xxx
touch apple-app-site-association
vim apple-app-site-association
nginx 配置
# iOS Universal Link 配置,在用户打开这个链接时可以无缝重定向到对应的APP,且不需要通过Safari浏览器。
location /.well-known/apple-app-site-association {
alias /xxx/apple-app-site-association;
add_header Content-Type application/json;
}
location /apple-app-site-association {
alias /xxx/apple-app-site-association;
add_header Content-Type application/json;
}