9

I have a few apps associated with the same domain. They are listed in the apple-app-site-association file in a specific order to make sure each universal link is opened by the most suitable app installed on the device. This works fine on iOS 14 and older devices. On iOS 15 that order is no longer respected and the links are opened not by the first but by the last app, that matches the link's path.

Here is my apple-app-site-association file:

{
    "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": [ "/*" ]
            }
        ]
    }
}

On iOS 14 the BurritoApp handles burrito links as expected.

When I install all 3 apps on a device with iOS 15 and tap on a burrito link, OrderAnythingApp handles the link. If I remove the OrderAnythingApp section from the above association file, then FoodApp starts handling the burrito links.

I searched through the documentation, I watched WWDC videos related to universal links from 2020 and 2019, I tried with the new association file format with components instead of paths. I still have no clue what causes this and how to fix it.

Vladimir Grigorov
  • 10,903
  • 8
  • 60
  • 70

1 Answers1

5

It seems the order of the links should be the opposite for iOS 15.

I could not find official documentation about it. After lots of trials and errors, I found out this association file works as expected for 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/*"
                    }
                ]
            }
        ]
    }
}

Unfortunately, this does not work on iOS 14. If someone has an idea how to fix it for both iOS 14 and iOS 15, please tell me.

Vladimir Grigorov
  • 10,903
  • 8
  • 60
  • 70
  • 1
    any luck with the universal solution to support both iOS 14 and 15? – Schiopu Evgheni Mar 23 '22 at 16:27
  • 1
    @SchiopuEvgheni: No luck, unfortunately. I gave up and implemented the iOS 15 solution in production. – Vladimir Grigorov Mar 24 '22 at 07:52
  • 1
    And what if iOS 16 will change the reading order again? I also investigated on the topic. Probably, the best way to solve this is to have unique paths. – Schiopu Evgheni Mar 24 '22 at 09:52
  • 1
    Do you see any new strange behavior starting from iOS15.4? It seems that the order is not respected at all and I could not understand the way the association file is processed @VladimirGrigorov – Donz May 11 '22 at 13:37
  • You can try old syntax like `paths [{"/deli/*}]"` instead of `components [{"/": "/deli/*"}]`. If it would work - write the both like in https://www.reddit.com/apple-app-site-association – Nike Kov Feb 28 '23 at 16:07