iOS Universal Links 配置流程

2017/11/29 posted in  tech
  1. 创建一个 apple-app-site-association 文件(JSON), 配置具体某个 App 可以 handle 哪些 url 示例: { "applinks": { "apps": [], "details": [ { "appID": "applinks:2HHW7J2HF4.com.diqiugang.2c", "paths": [ "*"] } ] } }
  2. 上传文件到一个 https 的 web server 上, 可以放在根目录 / 或者 .well-known 文件夹下
  3. 设置app 处理 universal links 1) 设置 com.apple.developer.associated-domains 字段, 添加一个需要 Universal links 处理的域名列表. To do this in Xcode, open the Associated Domains section in the Capabilities tab and add an entry for each domain that your app supports, prefixed with applinks:, such as applinks:www.mywebsite.com. Limit this list to no more than about 20 to 30 domains. 2)

从iOS 9.3开始, 只支持和当前页面不同域情况下打开App