Deep Linking Mechanisms Deep Dives
Apple Universal Links
… which are intended to direct users to the optimal location on web or the app. They were intended to take users to mobile web if the user doesn’t have the app, but take the user to the exact content in the app if they do. On a mobile device, if the user follows a universal link and has our app installed, they may be directed to the app, otherwise the system will fallback and land the visitor on our mobile website (with a few exceptions — see below).
For a link to be truly Universal, it requires that the linked feature is enabled on web, iOS and Android and for all apps to share the same resource path.
How it Works
Universal Links have two key components:
- AASA: Apple App Site Association file hosted on the domain of the links which will open the app immediately if the user has the app. (Documented here)
- Associated Domains: A small code change in the Entitlements > Associated Domains file of the iOS app.
It’s important now to distinguish an essential point – Universal Links are not a “set of links” but rather a system that is setup on links that your domain uses.
Universal Links can be enabled on your own company domain URLs as well as 3rd Party Attribution URLs. At AppsFlyer, we call this OneLink. Here’s an example with an AppsFlyer power user:
Walmart.com link, which has “Universal Links” enabled on them: https://www.walmart.com/ip/Banana-Dog-Costume/172218418
AppsFlyer OneLink, which has “Universal Links” enabled on them:
In the top case, the entire URL will come into the app via continue UserActivity, and you can then parse and route the user accordingly. In both cases, it is assumed that the developer will have some type of parsing and routing on each link. In the above case the developer might parse everything after the domain. In the bottom case, the developer will handle the af_dp value explicitly. This is at the core of handling static value deep links.
As a final note, it is important to point out that almost every company’s AASA is hosted at their main domain followed by “/apple-app-site-association” and therefore you can easily find the AASA file for any company.