1. 新建名称为apple-app-site-association文件。
不能新建文本格式的后缀。比如用txt新建,完成后需要去除txt格式。
2. 配置apple-app-site-association文件里面的内容。
details:也可以是多个team
appID:开发账号里面的证书对应的teamID,和Bundle identifier。
paths是指:是设置允许的路径列表
是一个也可以是多个,最简单的方式是使用“*”,通配符。表示允许该域名下的任意路径。
{
"applinks": {
"apps": [],
"details": [
{
"appID": "teamID.Bundle identifier",
"paths": ["*"]
}
]
}
}
3. 上传服务器。
将apple-app-site-association文件上传到域名的根目录下或者.well-known的子目录下。
文件路径,二选一(不带任何后缀):
https:// {host} /apple-app-site-association
https:// {host} /.well-known/apple-app-site-association
4. 测试是否配置完成。
苹果提供的测试工具:测试工具
5. Xcode工程配置。
工程配置中相应功能:targets->Signing&Capabilites->Capability->Associated Domains,在其中的Domains中填入你想支持的域名host,也必须必须以applinks:为前缀。比如applinks:www.xxxxx.com
6. 开发账号配置。
配置证书签名的时候,勾选Associated Domains就可以了。