1. 新建名稱為apple-app-site-association文件。
不能新建文本格式的后綴。比如用txt新建,完成后需要去除txt格式。
2. 配置apple-app-site-association文件里面的內(nèi)容。
details:也可以是多個team
appID:開發(fā)賬號里面的證書對應(yīng)的teamID,和Bundle identifier。
paths是指:是設(shè)置允許的路徑列表
是一個也可以是多個,最簡單的方式是使用“*”,通配符。表示允許該域名下的任意路徑。
{
"applinks": {
"apps": [],
"details": [
{
"appID": "teamID.Bundle identifier",
"paths": ["*"]
}
]
}
}
3. 上傳服務(wù)器。
將apple-app-site-association文件上傳到域名的根目錄下或者.well-known的子目錄下。
文件路徑,二選一(不帶任何后綴):
https:// {host} /apple-app-site-association
https:// {host} /.well-known/apple-app-site-association
4. 測試是否配置完成。
蘋果提供的測試工具:測試工具
5. Xcode工程配置。
工程配置中相應(yīng)功能:targets->Signing&Capabilites->Capability->Associated Domains,在其中的Domains中填入你想支持的域名host,也必須必須以applinks:為前綴。比如applinks:www.xxxxx.com
6. 開發(fā)賬號配置。
配置證書簽名的時候,勾選Associated Domains就可以了。