Questions about Universal Links and access encountered

background

- iOS 13 对三方App的跳转安全级别的要求提高
- 一些大厂的 SDK 积极响应要求,如我们就是在接入 QQ 互联时只能下载最新的SDK,要求必须使用 Universal Links

Development and testing environment

- Mac 10.14.5 iOS 13.2.3 iphone 7
- QQ SDK 3.3.7

Problems encountered

- 在 iOS 13 以下的系统可以正常分享, 13的系统初次安装可分享之后均不能分享,如下图每次会检查

universal_links_01

Apple Support Universal Links

- 创建名字为 `apple-app-site-association` 且饮食的数据为 JSON 格式,文件内容决定你的 APP 可以处理那些 URL
- 将文件 `apple-app-site-association` 给服务端且必须支持 **https**,文件的位置放在根目录下或 `.well-know` 子文件夹下(个人建议两处都放,开始就是因为后者路径下没话,害我调试了半天,后面会贴出调试方法)
- 准备 APP 要处理的 Universal Links

Create a apple-app-site-associationfile

- 基本的格式如下  
{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "9JA89QQLNQ.com.apple.wwdc",
                "paths": [ "/wwdc/news/", "/videos/wwdc/2015/*"]
            },
            {
                "appID": "ABCD1234.com.apple.wwdc",
                "paths": [ "*" ]
            }
        ]
    }
}

These are the apple-app-site-associationcontents of the sample file, not to take note that the file name behind the suffix of .json
the current content developers can change that appID & paths, applinks \ apps fixed wording;
appID consists of: developer account application ID: you in Xcode Domain in fill domain
paths legitimate path to your own definition, here to write the path, you can spell like this: HTTPS: //com.apple.wwdc/wwdc/news/ , this route opens in Notepad and your phone's Safari will be transferred to your APP
*: wildcard, /*said: /all paths after the match

Xcode related configuration

universal_links_02

Verify that the configuration is successful (enter your own domain name in the following two ways)

- 在手机自带的 APP 备忘录 中输入 https://help.wechat.com/app/,如下图表示成功

universal_links_03

- 在手机的 Safari 中输入 https://help.wechat.com/app/,如下图表示成功(这里要多下拉几次,藏在网址的导航栏下面)

universal_links_04

Problems encountered

- 在 iOS 的 13 及以上的系统上,当时在服务端的 .well-konw 路径下没有放 AASA 文件,导致 13 系统的手机一直下载不成功
- 参考 stackoverflow 上的方法调试找到下载不成功的原因,加上后测试就Ok了
<a href='https://stackoverflow.com/questions/32751225/ios-universal-links-are-not-opening-in-app'>Stackoverflow Univerlinks</a> 
- 调试步骤:
    * 在 Xcode 中 Window -> Device and Simulators -> Open Console -> 在左边栏打开选择你的设备
    * 在右上角的搜索框中输入 `swcd` 去检索你下载 AASA 文件的相关信息
    * 手机没有下载如下图

universal_links_06

    * 下载成功的大概如下图

universal_links_05
universal_links_07
universal_links_08

supplement

Official test, but it seems only the shelves will be detected by the development of less than

Guess you like

Origin www.cnblogs.com/tzsh1007/p/12198442.html