I am struggling getting universal links/applinks working for an App Store Event. I have been through the docs and various troubleshooting methods a number of times and cannot figure out why the universal link is not opening the app.
Here's the apple-app-site-association file we have hosted on our website in .well-known (full url https://binaryformations.com/.well-known/apple-app-site-association):
{
"applinks": {
"details": [{
"appIDs": ["com.BinaryFormations.UnderMyRoof"],
"components": [{
"/": "/umrappevent/*",
"comment": "Matches any URL whose path starts with /umrappevent/"
}]
}]
}
}
Here's the configuration in the Associated Domains section in Xcode:
I've also implemented scene(_ scene: UIScene, continue userActivity: NSUserActivity) in the window scene delegate.
Just to see if it might solve the problem, I also implemented application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool in the application delegate.
I've been testing with this URL, among others, and the app is not being opened:
https://binaryformations.com/umrappevent/9999
I've tried every troubleshooting technique I could find, including the once mentioned in TN3155 on debugging universal links (https://developer.apple.com/documentation/technotes/tn3155-debugging-universal-links) and everything seems to be as it should. Here's a summary of what I've tried so far:
Checked that the CDN was returning the correct apple-app-site-association file:
https://app-site-association.cdn-apple.com/a/v1/binaryformations.com
Ran the following test with curl to verify there are no redirects (it returned with the response code of 200):
curl -v https://binaryformations.com/.well-known/apple-app-site-association
Using the above mentioned apple-app-site-association file as test.json, I randomly this test using swcutil and the URL seems to match fine:
sudo swcutil verify -d binaryformations.com -j test.json -u https://binaryformations.com/umrappevent/9999
{ s = applinks, a = com.BinaryFormations.UnderMyRoof, d = binaryformations.com }: Pattern "https://binaryformations.com/umrappevent/9999" matched.
Associated Domains Development Diagnostics on the phone seem to indicate everything is okay with the URL:
Last one: after installing a build from TestFlight on an iPhone (iOS 18), I see this in the swcutil_show.txt file from a sysdiagnose after trying the following link:
https://binaryformations.com/umrappevent/9999
Service: applinks
App ID: G52SXV33MH.com.BinaryFormations.UnderMyRoof
App Version: 20240910.0
App PI: <LSPersistentIdentifier 0x4f8026100> { v = 0, t = 0x8, u = 0x474, db = 52D70E5E-2E19-4D2C-ADA7-1E6154CA1AFA, {length = 8, bytes = 0x7404000000000000} }
Domain: binaryformations.com
User Approval: unspecified
Site/Fmwk Approval: denied
Flags:
Last Checked: 2024-09-11 15:36:17 +0000
Next Check: 2024-09-16 15:17:08 +0000
I'm sure I'm doing something silly that I just keep overlooking, but cannot seem to figure it out. Is there anything that's jumping out from all of this that I'm missing? Is there any way to get more information from the diagnostics as to why the rule was denied or anything else I should try?
Thank you in advance.
I went over everything again and noticed that my developer Team ID was prepended to the app's bundle id for the denial entry in swcutil_show.txt.
The documentation (https://developer.apple.com/documentation/xcode/supporting-associated-domains) says the appIDs entry should be in the form of <Application Identifier Prefix>.<Bundle Identifier>. I'd assumed Application Identifier Prefix was the Apple ID of the app as I've seen these used interchangeably before. Anyway, I added the Team ID as a prefix and all is working.
Not sure if this is an error in the documentation or if app's Apple ID is used in production. As a hedge I added both variants (prefixed by Team ID and prefixed by App ID) to the appIDs entry.