3

Background:

  1. Building a vanilla app for multiple clients. Same code base with different bundle ids, i.e.:

    com.company.client1

    com.company.client2

  2. Want to support all client builds with the same universal app link, i.e.:

    company.com/app/path

  3. Tried to add this to the 'apple-app-site-association' file

'apple-app-site-association' file:

{"applinks": {"apps": [],"details": [
{"paths": ["/app/*"],"appID": "XXXXXXXXXX.com.company.client1"},
{"paths": ["/app/*"],"appID": "XXXXXXXXXX.com.company.client2"}]}

Is this a limitation from apple?

jyliang
  • 198
  • 2
  • 7

1 Answers1

6

This is possible. There is no limitation from Apple on Universal Links for multiple apps on the same domain.

It appears your apple-app-site-association is malformed. You need it to look like this:

{
  "applinks": {
    "apps": [ ],
    "details": [
      {
        "appID": "XXXXXXXXXX.com.company.client1",
        "paths": [
          "/app/*"
        ]
      },
      {
        "appID": "XXXXXXXXXX.com.company.client2",
        "paths": [
          "/app/*"
        ]
      }
    ]
  }
}

Note the order of the appID and paths keys, and the final closing }.

You will also run into issues with this setup if more than one app is installed, since they're all registering for the same paths. You may want to consider adding a unique ID to each one, such as /app/client1/*.

Another important note is that Universal Links don't work in many situations so this is not a complete deep linking solution (despite Apple's wishful claims to the contrary). If you want a simpler deep linking approach that will easily handle a multi-app requirement like this, take a look at Branch.io (full disclosure: I'm on the Branch team).

Alex Bauer
  • 13,147
  • 1
  • 27
  • 44
  • I am using Branch.io currently. Do you have suggestions on the best way to handle the OP's scenario using Branch.io? – cmour May 25 '17 at 23:58
  • @cmour this is an advanced config that currently has to be enabled by our Integrations team. Could you please [send them a ticket](https://support.branch.io/support/tickets/new) so they can help you out? – Alex Bauer May 26 '17 at 04:30
  • 1
    @AlexBauer If any user having app with bundle ID as com.company.client2, is the OS will redirect to the respective app? Or it will redirect to com.company.client1 because its on the first position on Array? My question is that, is the bundle ID will match while the deep link will call? or it directly satisfy the first one? – Ronak Joshi Jun 08 '20 at 07:57
  • @AlexBauer I do that still only one app open when I click on universal link please help me. – Rahman Rezaee Apr 18 '21 at 06:41