问题
Background:
Building a vanilla app for multiple clients. Same code base with different bundle ids, i.e.:
com.company.client1
com.company.client2
Want to support all client builds with the same universal app link, i.e.:
company.com/app/path
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