【问题标题】:apple-app-site-association app order is not respectedapple-app-site-association 应用程序顺序不受尊重
【发布时间】:2021-11-24 16:35:32
【问题描述】:

我有几个应用与同一个域相关联。它们按特定顺序列在 apple-app-site-association 文件中,以确保每个通用链接都由设备上安装的最合适的应用程序打开。这在 iOS 14 和更早的设备上运行良好。在 iOS 15 上,不再尊重该顺序,并且链接不是由第一个而是由最后一个应用打开的,它与链接的路径匹配。

这是我的 apple-app-site-association 文件:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "AAAAA.com.mydomain.BurritoApp",
                "paths": [ "/burritos/*" ]
            },
            {
                "appID": "AAAAA.com.mydomain.FoodApp",
                "paths": [ "/burritos/*", "/tacos/*", "/deli/*" ]
            },
            {
                "appID": "AAAAA.com.mydomain.OrderAnythingApp",
                "paths": [ "/*" ]
            }
        ]
    }
}

在 iOS 14 上,BurritoApp 按预期处理墨西哥卷饼链接。

当我在装有 iOS 15 的设备上安装所有 3 个应用并点击墨西哥卷饼链接时,OrderAnythingApp 会处理该链接。如果我从上述关联文件中删除 OrderAnythingApp 部分,则 FoodApp 开始处理墨西哥卷饼链接。

我搜索了文档,观看了 2020 年和 2019 年与通用链接相关的 WWDC 视频,我尝试使用带有组件而不是路径的新关联文件格式。我仍然不知道是什么原因造成的以及如何解决它。

【问题讨论】:

    标签: ios ios-universal-links ios15


    【解决方案1】:

    iOS 15 的链接顺序似乎应该相反。

    我找不到有关它的官方文档。经过大量的试验和错误,我发现这个关联文件在 iOS 15 上可以正常工作:

    {
        "applinks": {
            "details": [
                {
                    "appID": "AAAAA.com.mydomain.OrderAnythingApp",
                    "components": [
                        {
                            "/": "/*"
                        }
                    ]
                },
                {
                    "appID": "AAAAA.com.mydomain.FoodApp",
                    "components": [
                        {
                            "/": "/burritos/*"
                        },
                        {
                            "/": "/tacos/*"
                        },
                        {
                            "/": "/deli/*"
                        }
                    ]
                },
                {
                    "appID": "AAAAA.com.mydomain.BurritoApp",
                    "components": [
                        {
                            "/": "/burritos/*"
                        }
                    ]
                }
            ]
        }
    }
    

    很遗憾,这不适用于 iOS 14。如果有人知道如何在 iOS 14 和 iOS 15 上修复它,请告诉我。

    【讨论】:

      猜你喜欢
      • 2018-12-15
      • 2019-09-21
      • 2017-02-16
      • 2022-07-29
      • 1970-01-01
      • 2017-08-20
      • 1970-01-01
      • 2016-05-13
      • 2020-08-28
      相关资源
      最近更新 更多