We're trying to get universal links working in our app but we are encountering errors when trying to download the Apple App Site Association file.
We've used various online tools to validate the file and they all say their is a parsing error but they don't go into any detail about what the issue is.
We've validated that the JSON is valid but what else could be wrong with the file contents?
{
"applinks": {
"details": [
{
"appIDs": [ "12345NGB.co.uk.my.app" ],
"components": [
{
"/": "/universallink/*",
"comment": "Matches any URL whose path starts with /universallink/"
}
]
}
]
}
}
It turns the I did need to follow the format outlined here: https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
{
"applinks": {
"apps": [],
"details": [{
"appID": "12345NGB.co.uk.my.app",
"paths": ["/universallink/*"]
}]
}
}
The Apple documentation is very misleading because it suggests that's an old format for supporting iOS 12 and earlier.
Related
I've been trying to add the universal links to my app. currently the scheme links work fine. I am working with expo, and expo linking I have this type of links working:
dandy://SquadSingle?id=6111b70f76cefd027b664270
And I want it to work as:
www.mysite.com/SquadSingle?id=6111b70f76cefd027b664270
The ASSA file in my website is this one, located in mysite.com/.well-known/apple-app-site-association:
{
"applinks": {
"apps" : [],
"details": [
{
"appIDs": ["<TeamID>.<BundleID>"],
"components":[
{
"/": "/SquadSingle/",
"comment": "Mathces any URL whose path starts with /SquadSingle/"
},
]
},
{
"appID": "<TeamID>.<BundleID>",
"paths": [
"/SquadSingle/*",
"*"
]
}
]
}
"activitycontinuation": {
"apps": [
"<TeamID>.<BundleID>"
]
}
}
I added the configuration of associatedDomains to the app.json like this:
"ios": {
...
"associatedDomains": [
"applinks: <mysite>.com"
],
...
}
I have already enabled the associated domains in my developer.apple
I uploaded my .IPA to App Store connect to try on testflight but but even then the app does not open the desired links.
Can somebody help me please?
I'm trying to set up an apple-app-site-association file for several apps that share a common set of paths. There are two sets of documentation from Apple that conflict. Firstly, this doc says that each app should have its own section and then there is a paths element that contains mappings:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "9JA89QQLNQ.com.apple.wwdc",
"paths": [ "/wwdc/news/", "/videos/wwdc/2015/*"]
},
{
"appID": "ABCD1234.com.apple.wwdc",
"paths": [ "*" ]
}
]
}
}
Then there is this doc for XCode which shows a quite different format:
{
"applinks": {
"details": [
{
"appIDs": [ "ABCDE12345.com.example.app", "ABCDE12345.com.example.app2" ],
"components": [
{
"#": "no_universal_links",
"exclude": true,
"comment": "Matches any URL whose fragment equals no_universal_links and instructs the system not to open it as a universal link"
},
{
"/": "/buy/*",
"comment": "Matches any URL whose path starts with /buy/"
},
{
"/": "/help/website/*",
"exclude": true,
"comment": "Matches any URL whose path starts with /help/website/ and instructs the system not to open it as a universal link"
},
{
"/": "/help/*",
"?": { "articleNumber": "????" },
"comment": "Matches any URL whose path starts with /help/ and which has a query item with name 'articleNumber' and a value of exactly 4 characters"
}
]
}
]
},
"webcredentials": {
"apps": [ "ABCDE12345.com.example.app" ]
},
"appclips": {
"apps": ["ABCED12345.com.example.MyApp.Clip"]
}
}
Neither document has any date or version information, so I can't tell which is more recent or correct.
The appIDs themselves are also confusing because there are apparently multiple sources of these identifiers, but not all of them will work, though I can't tell if that's my problem now.
I'm serving my document from /.well-known/apple-app-site-association, but I find a validator gives odd validation failures such as not being able to get the file (though fetching it with curl or a browser works fine), and a complaint that it can't be verified with openssl, which makes no sense because it contains nothing that's even vaguely related to certificates or signatures. Why does the document need to be delivered with a application/pkcs7-mime MIME type when it's neither MIME nor PKCS7 format?
Looking at Apple's own AASA, I see that it uses both of these formats! It also fails validation in all of the validators I tried, including Apple's own! This is very confusing.
How exactly should this document be formatted?
I am having doubts regarding a particular scenario on adding paths to an association file.This is an association file for a site www.abc.com.Now the site starts to support localization ,For ex. www.abc.com/en-ca for Canada,it will display a localised Canadian site.In future more locales will be added.The rest of the paths mentioned in the association file are same (ex. www.abc.com/path1/* now becomes www.abc.com/en-ca/path1/*.How can the association file be modified in such a way that it supports www.abc.com/en-ca and many more locales in the future?
{
"applinks": {
"apps": [],
"details": [
{
"appID": "teamid.com.xxx.appName",
"paths": [
"/",
"/path1/*",
"/xx/xx/path2*",
"/path3",
"/path4/*",
"/path5*",
"/path6*"
]
}
]
},
"webcredentials": {
"apps": [
"teamid.com.xxx.appName"
]
}
}
As Documentation says you can use:
/photography/*/samples/201?/mypage
So in your example, it would be:
"paths": [
"/",
"/path1/*",
"/xx/xx/path2*",
"/path3",
"/path4/*",
"/path5*",
"/path6*"
"/*/",
"/*/path1/*",
"/*/xx/xx/path2*",
"/*/path3",
"/*/path4/*",
"/*/path5*",
"/*/path6*"
]
I have an app on the app store that use UniversalLinks I want to be able to test the functionality in development also.
Is it possible to have the apple-app-site-association file like so with both signatures?
{
"applinks": {
"apps": [ ],
"details": [
{
"appID": "XXXXXXXXXX.EP.myCompany.client",
"paths": [
"*", "/"
]
},
{
"appID": "XXXXXXXXXX.com.myCompany.client",
"paths": [
"*", "/"
]
}
]
}
}
Yes, you can.
Check out examples from others to see how AASA is formatted. Like https://facebook.com/apple-app-site-association or https://amazon.com/apple-app-site-association
I have an application which supports universal links and it is currently in the app store.
Say it supports the domain www.example.com and thus universal links can be easily opened via this. We will have applinks:www.example.com in associated domains.
Now say if I want to release another app and it also supports the same domain. Now how will iOS distinguish which app to open via universal links..?
In order to supporting Universal Links with single domain on two different apps you need to make changes in your existing apple-app-site-association file, at https://{domain}/apple-app-site-association.
For Single App Support
For single application support it's look like this
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234ABCDE.com.domain.myapp",
"paths": ["*"]
}
]
}
}
For Multiple App Support
For multiple application support, you need add one more key-value pair in details array of applinks in apple-app-site-association. It's look like this
{
"applinks": {
"apps": [],
"details": [
{
"appID": "1234ABCDE.com.domain.myApp",
"paths": ["*"]
},
{
"appID": "1234ABCDE.com.domain.mySecondApp",
"paths": ["*"]
},
{
"appID": "1234ABCDE.com.domain.myThirdApp",
"paths": ["*"]
}
]
}
}
General Format of apple-app-site-association file
The file looks like this:
{
"applinks": {
"apps": [ ],
"details": [
{
"appID": "{app_prefix}.{app_identifier}",
"paths": [ "/path/to/content", "/path/to/other/*", "NOT /path/to/exclude" ]
},
{
"appID": "TeamID.BundleID2",
"paths": [ "*" ]
}
]
}
}
References
How to support Universal Links in iOS App and setup server for it?
I found the solution, its pretty simple though.
My problem was that my first app was supporting all the pages by stating
"*" in the paths section of apple-app-site-association file. Now all I have to do is add NOT in front of one of the paths which I wanted my second app to handle.
like "NOT /cabs". I haven't tested it yet if this works or not. I will post an update as soon as I am done with it.
Apple App Site Association file example
{
"applinks": {
"apps": [],
"details": [{
"appID": "D3KQX62K1A.com.example.photoapp",
"paths": ["/albums"]
},
{
"appID": "D3KQX62K1A.com.example.videoapp",
"paths": ["/videos"]
}]
}
}
Important: The order of the dictionaries in the array determines the order the system follows when looking for a match. The first match wins, allowing you to designate one app to handle specified paths within your website, and another app to handle the rest.
References:
https://developer.apple.com/documentation/uikit/core_app/allowing_apps_and_websites_to_link_to_your_content/enabling_universal_links