What is Apple App Site Association?
Apple App Site Association (AASA) is a JSON file that enables iOS apps to securely communicate with their associated websites and safely prove domain ownership. AASA allows apps and their websites to share features, web credentials, and Universal Links to create a consistent user experience.
When a user on an iOS device running iOS 9 or later clicks on a link, the device checks whether that link should be handled by an app instead of being passed to Safari. These links that can open the app, if it is installed, or fallback to the web, if not, are known as Universal Links.
In order to verify that an app is truly associated with a web domain, owners of the website must host an Apple App site association file on their domain with the corresponding app information. This file includes the app ID of each app that should be associated with that domain, as well as, all of the paths that each of those apps should handle. Here is the example from Universal Links documentation:
"paths": [ "/wwdc/news/", "/videos/wwdc/2015/*"]
"paths": [ "*" ]
In this example, you can see that the first app will handle the paths domain.com/wwdc/news/ and domain.com/videos/wwdc/2015/* and the second app will handle everything. In the case that both apps are installed, the device will choose the app to open based on ordering of the apps in the AASA file. So the news endpoint will always open the first app.
The AASA file is downloaded onto a device during app install or update. This makes changing the file difficult since it will not be updated on every device until those devices update or reinstall.