We are in the progress of creating a new application and I'm facing some issues with the usage of app links.
So I added the entitlements and I'm hosting the ".well-known/apple-app-site-association" file on my servers, that seems to be all good.
Then I'm testing the applinks by triggering them on my simulator using this command: /usr/bin/xcrun simctl openurl booted "https://links.domain.com/path/token"
and nicely triggers my application.
Then I started testing on real devices and all of the sudden it did not work anymore, I'm using the default mail app on these devices, and that is were the problem is.
If I put the link inside a note (Notes app) it opens my app. If I open my email from the GMail app it launches my application, but that same exact email from the same gmail account but inside the Apple Mail app does not do a thing...
I tried this right now both on iOS 13 and iOS14.
The content of the hosted apple-app-site-association file looks like this:
{
"applinks": {
"apps": [],
"details": [
{
"appID": "0000X0XXXX.com.domain.appname",
"paths": ["*"]
}
]
},
"webcredentials": {
"apps": [ "0000X0XXXX.com.domain.appname" ]
}
}
Any ideas on what we can try next would be welcome. The only thing I can imagine is that the Mail app does some extra checks on whether your an app on the AppStore or not, but that would be a bit weird, no?!
Ok, I did find the issue and fix... It's not that hard actually and I bumped into it accidentally...
It seems that Apple does a really bad job in parsing HTML, in particular the href
attribute of a link. While I could not find any other client that behaves the same, it seems that if you don't put the scheme (http or https) in front of the url (so instead of https://google.com I was using just google.com) which you provide to the href
attribute, then Apple makes something of it's own out of it: x-webdoc://30E09690-F388-4ED2-BB46-14DC829B974C/google.com
.
I could spot this on the Apple Mail app, however on the iPhone where I was having the issue it was not even recognised as a link, so the behaviour seems to be a little different between their own apps.
In the end it was my mistake for not putting https://
in front of my auto generated URI's. However I do think Apple does a poor job here in building the link HTML tag.