2. 创建 apple-app-site-association 文件,无json等后缀名
eg: appID 构成 teamId + bundleId
{ "applinks": { "apps": [], "details": [ { "appID": "2TEAM6D5.com.baidu.TEST", "paths": ["*"] } ] } }
3. 上传apple-app-site-association到applinks中填写的https服务器根目录或者.well-known目录下。
如果是nginx服务器,可以配置nginx如下:
location /apple-app-site-association { add_header Content-Type text/plain; root /.well-known; index apple-app-site-association; } location /.well-known/apple-app-site-association { add_header Content-Type text/plain; root /.well-known; index apple-app-site-association; }
确保地址 https://域名/apple-app-site-association 可以访问,就说明大致可以了!
4. 重新安装app,然后就可以测试
关于测试
创建apple-app-site-association文件后,将其上传到 HTTPS Web 服务器的根目录或子目录.well-known。该文件需要可通过 HTTPS 访问(无需任何重定向),地址为https:///apple-app-site-association或https:///.well-known/apple-app-site-association。接下来,您需要处理应用程序中的通用链接
即配置成以后,有3个链接要访问成功才可以:
https://你的域名.com/apple-app-site-association https://你的域名.com/.well-known/apple-app-site-association https://app-site-association.cdn-apple.com/a/v1/你的域名.com
最后一个链接是苹果CDN链接,可以理解为只要这个地址像下图一样返回正常,就说明我们配置的AASA文件没有问题
在shell里面运行:
curl -v https://app-site-association.cdn-apple.com/a/v1/你的域名.com
能够访问到说明正常了!
相关参考如下:关于ios Universal Links apple-app-site-association文件 Not Found的问题_ios_什么香香脆脆我们最爱-华为云开发者联盟