0

I've had a look at this post but it doesn't address our current issue. We are looking to partner with a given company on a venture and the question is can our apple site association files hold each others team and applications ids but still respond to the same domain? i.e. our server would hold:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "1234ABCDE.com.ourdomain.ourApp",
                "paths": ["*"]
            },
            {
                "appID": "D3KQX62K1A.com.theirdomain.theirApp",
                "paths": ["*"]
            }

        ]
    }
}

This means our app can have applinks:ourdomain.com in associated domains of our app. Their server would hold:

{
        "applinks": {
            "apps": [],
            "details": [
                {
                    "appID": "1234ABCDE.com.ourdomain.ourApp",
                    "paths": ["*"]
                },
            {
                "appID": "D3KQX62K1A.com.theirdomain.theirApp",
                "paths": ["*"]
            }

            ]
        }
    }

Then in their associated domains they can have: applinks:ourdomain.com as well. So that if a user presses a ourdomain.com url and their app is installed it would open their app? I'm looking to see if we can have their app open when one of our URLs are pressed and a user has their app installed. What would happen in the scenario if a user has both our apps installed?

user481610
  • 3,230
  • 4
  • 54
  • 101

1 Answers1

0

Generic Answer

This will certainly work — it's exactly how Universal Links are intended to function. You're fulfilling the two required parts:

  1. Verifying 'control' of the domain using the apple-app-site-association file.
  2. Requesting verification of the domain using the applinks: entitlement inside the app.

It doesn't matter who officially owns the domain as long as both pieces are present.

As far as what happens when both apps are installed at the same time, Apple is (of course) correct: this is undefined. That means Apple has specifically chosen not to support this situation, so there is no guarantee about what will happen. To avoid it, you should not use "paths": ["*"] for both apps; instead, do something like "paths": ["/ourApp/*"] and "paths": ["/theirApp/*"] to differentiate the links based on path.

Branch-Specific Info

Since you mentioned Branch.io (full disclosure: I'm on the Branch team), I'll also cover how this typically works on our service.

We provision and host the apple-app-site-association file automatically for every app, so you don't need to worry about the technical details. When we have two apps interested in partnering with each other this way, the process is simple:

  1. You want to open their app.
  2. You are given their app's Branch key.
  3. You use their app's Branch key to generate links, often by appending query parameters.
  4. These links will automatically open their app, just the same as if they had generated the links.
Alex Bauer
  • 13,147
  • 1
  • 27
  • 44