Can iOS universal app link support multiple apps using the same domain?

倖福魔咒の 提交于 2019-12-24 00:26:20

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/40790747/can-ios-universal-app-link-support-multiple-apps-using-the-same-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!