Apple launched Universal Links on iOS9 in 2015 as an alternative solution to deep linking and URI schemes.
Let’s begin with a definition of universal linking
Universal linking is Apple’s solution of pointing a link to a website page or application regardless of whether the application is installed on the user’s phone. It is a deep linking protocol exclusive to Apple devices version 9 and later.
What is unique about Universal Linking?
Universal links allow users to intelligently follow links to content in your app or your website. They provide users with an integrated mobile and desktop experience, even when your app isn’t installed on their phone.
Some of the benefits of universal links, according to Apple, are
What are Universal links used for?
Developers use universal links to create a two-way association between their mobile applications and website. A universal link can open both, depending on the user’s preference.
How does iOS Universal Link Work?
A universal link is a single link that can take the user to a specific place in an app or an associated webpage. The link’s path depends on whether the app is installed on the user’s phone and the preferences based on previous interactions with universal links.
A universal link aims to respect where the user wants to view the content if a web browser or an application. When users click on a universal link, the system redirects the link directly to the application without going through Safari.
Universal links are standard HTTP or HTTPS links. Therefore, a single link can connect to an app and a website. If a user installs your app, the system verifies your website and allows your app to open URLs on its behalf.
In addition, apps can communicate with each other through universal links.
An app that supports universal links allows other apps to send small amounts of data, directly to the app, without using a third-party server.
The Apple documentation brings the following example of using universal linking to communicate between apps:
A photo library app that specifies parameters, including the name of an album and the index of a photo to display.
Other apps can create an URL based on the domain, path, or parameter. Then they can ask the app to open them by using one of these methods for calling:
1, open(_:options:completionHandler:) method of UIApplication in iOS and tvOS
Here is a code example of an app calling the universal link in iOS and tvOS
2. openSystemURL(_:) method of WKExtension in watchOS
Here is a code example of an app calls your universal link in watchOS:
3. open(_:withApplicationAt:configuration:completionHandler:) method of NSWorkspace in macOS
Here is a code example of an app calling an universal link in macOS:
How do you support universal links?
According to Apple developer documentation, an app developer that wants iOS users to connect to the app with universal links must take the following steps:
- Creating a two-way association between the app and the website, specifying the URLs of the application.
- Updating the app delegate to respond to user activity when a universal link routes the app.
Benefits of Universal Links
There are several advantages to using universal links:
Simplified User Experience
Before universal links, users that wanted to connect to an app from a link, were served a pop-up prompt asking where they wanted to open the app. This disrupted the user experience and often resulted in users bouncing away.
Universal links take the user where they want to go with a single link. Thus simplifying the user experience. Because there are no disruptions, the chances of conversions are greater.
Universal links are also a way to increase user engagement. Marketers can direct the link to the best location in the app for conversions. Users then can go exactly where they need, resulting in more efficient use of the app.
Happy users come back. Not only there is an improved user experience, but users can convert faster, — complete purchases in fewer steps—. Therefore, universal links tend to increase retention and conversion rates.
The improved analytics capabilities of universal links, makes them a versatile tool for marketers. For instance, they can use universal links for accurately attribute and reattribute events.
Deep Linking Definition
Deep linking was the standard method for iOS apps. App developers implemented Uniform Resource Identifiers (URI) schemes to simplify the path of linking users directly to a destination inside the app.
For example, fb:// opens the Facebook app, and when adding profile details, it can direct the user to a specific profile.
The problem with deep links is that they work great when the app is installed on the user’s phone.
But if the user doesn’t have the app installed, it shows the user a “Cannot open Page”, prompt in Safari, which impacts the user experience, as shown in the diagram below.
Universal Linking Definition
Universal links and app links are two powerful technologies that allow app developers to easily link their apps with web pages or other apps. These links offer a seamless user experience by directly taking users to the relevant content within the app or website, without the need for a web browser or a separate app.
Universal links are routed directly by the operating system, associating the app and the web page securely. The goal of universal links is to improve the user experience, whether the user has the app installed or not, creating a more secure connection between the web and the app.
Deep Linking vs. Universal Linking
Despite deep and universal links similarities, they have key differences. Let’s start by defining them:
A deep link links to a specific section within an application, such a specific page.
A universal link, works similarly to deep links but for iOS device, so Apple users can navigate directly to a specific point on an application.
There are several advantages to universal links, such as enhanced security features. Another advantage is that an universal link can be shared across multiple platforms and devices, while a deep link uses a custom URL which only works within a specific app.
Here is a summary of the main differences between Universal Links and Deep Links.
How to create and set up a Universal Link
Different platforms may have different dashboards to create universal links. On a high level, here are the basic steps to get universal linking working for your app.
1. Set your app to register approved domains
- Register your app with Apple at developer.apple.com
- Log in to developer.apple.com.
- Click on Certificates, Identifiers & Profiles. Then, on Identifiers.
- If you have an App Identifier, follow to the next section. If not, click on the + sign and fill out the form.
- Make sure your Xcode project has the same Team selected as your App Identifier.
- Go to the Capabilities tab and choose your project file
- Enable Associated Domains. Check your Bundle Identifier for your project matches the one registered with your App Identifier.
applinks:to your domain tag.
2. Set your website to host the apple-app-site association
- Buy or use your existing domain name
- Purchase the SSL certification for the domain
- Go to a third-party service and fill out the form to generate an openSSL command.
- Log into your remote server
- Execute the OpenSSL command and generate a certificate signing request (.csr) and certification file (.cert)
Create the apple-app-site-associationJSON file.
Setting up on iOS
Add the following in AppDelegate.m file so the app can listen to the incoming universal links.
Once you add the scheme to your Xcode project configuration, you need to setup the Associated Domains on your server
Run the following JSON code for an example of a simple association file:
Setting up on Android
Configuring external linking in Android requires to make changes to the manifest file. To do that:
- Open android/app/src/main/AndroidManifest.xml file:
- Go to MainActivity/launchmode and choose the setting to singleTask
- Inside the MainActivity, select VIEW and add a new intent-filter
- Ensure your new
has an android:autoVerify=”true”
- Add a new entry inside the
with your domain’s URL scheme and host.
How to Test Universal Links
Let’s explain it better with an example: imagine you create a React Native application. How do you test the universal links on iOS? Source
1. Open prompt and run the following code:
2. Create the RootNavigation.js file using the following code:
3. Build an app in React Native containing two screens. Open the App.js file and enter the following code:
4. Configure the React Navigation and the dependencies.
Testing on iOS
1. Check your app allows Associated Domains
Allowing associated domains enable the app to listen to incoming universal links requests. Follow the steps in the above section to enable this feature in your app Xcode project.
2. Set up a Digital Asset Links JSON file, like the following example:
3. Run the following command:
4. Test Universal Links Using Safari
According to the Apple’s developer forum, there are a few methods to test the universal link before releasing the application using Safari.
- You can simply embed the link in any webpage and then access the page from the Safari browser. If it opens the link then it works.
- If the application has a banner that shows up when scrolling, you can use that banner to enable universal links for the user.
There are limitations to testing universal links in Safari. For instance, you cannot use Safari wrappers to test universal links on some devices.
5. Test Universal Links Using Xcode Simulator
Until 2019, universal links wouldn’t work in the simulator, but could be tested from a device. Now you can use the User Interface Testing, released with iOS 9. Because universal links don’t work unless a user clicks on the link, it can be frustrating to try to test this in the simulator, so typing the link into Safari or redirecting with javascrip won’t open the application. But there is a simple workaround.
- Open the simulator’s iMessage app
- Select a contact and open up a chat
- Type the URL into the message bar and send the message
- Click the message bubble.
- The universal link should open the app.
Testing On Android
1. Technically, there are no universal links in Android:
Universal links are an Apple’s exclusive feature. Android has App Links, which behave similarly to universal links. Before testing universal links on Android, you should ensure your application can handle the incoming requests for universal links. As we mentioned above, the intent filters must include your domain scheme and host for the app’s universal links.
2. Test Universal Links Using Chrome:
Once your app’s intent filters are properly configured, you can test universal links on Android using Chrome. While universal links work when opened in Safari or Chrome, they don’t work if you enter the universal link in the Chrome address bar and press Enter. You should host the links in a web environment to test them.
Start by creating a testing page in HTML, the follow these steps:
- Add your complete universal link to the test webpage
- Install the app in the test device
- On the test device open the test web page from Chrome
- Click the universal link.
- If the link is configured correctly, your app should launch and take you to the relevant content.
3. Tips to debug Android App Links
- To debug your universal link for an Android app, first you need to ensure the device browser is not the default handler for the app link. If the user clicks the link before app links are enable, they have the option to select where they want to open the link, if they choose to open in browser “always”, the domain will not open the app, ever.
- If this happens, you can reset browser to default by following this path: Settings/Apps/select browser/defaults/”Clear Defaults”.
- All domains should pass verification. If you don’t have autoVerify=”true” in all intent filters, Android will verify all domains, and if one domain fails verification, App Links will be disabled for the rest.
4. Test Universal Links Using ADB:
You can also test universal links on Android using the Android Debug Bridge (ADB). To do this, connect your Android device to your computer, open a command prompt, and enter the following command: “adb shell am start -a android.intent.action.VIEW -d universal-link-url”. Replace “universal-link-url” with the actual universal link you want to test. If the link is configured correctly, your app should launch and take you to the relevant content.
Other Tips to test universal links
- Test the link on different channels. Not only on the web but also in social media, SMS, and messaging platforms.
- Keep in mind that universal links only work when clicked on.
- When testing, ensure the app is installed on the devices you will be testing.
Universal links have limitations too.
They are not Universal
The way that Apple implements Universal Links forced social media platforms such as Twitter, Pinterest, and Facebook to significantly change how they handle external links.
Currently, these apps intercept the link and open with an internal review to track the user’s web activity. A universal link must send the user externally, losing their track capabilities.
So, if you want to use universal links in social media, you must work around deep linking with legacy methods. Apple builds most apps that support universal links.
You can’t use universal links for email campaigns.
Many organizations use email to interact with their users and as a marketing tool. Tools like MailChimp or Sendgrid are commonly used to handle the volume of email campaigns. They provide services such as click-tracking, where they wrap the original link in a redirect so the user goes to the provider’s server before the final destination. That’s where the problem lies with universal links. You cannot wrap a universal link in a redirect.
Users can disable them.
It is simple to disable Universal links on the phone. Click the domain name in the top right-hand corner after clicking a universal link. If you do that, it opens the link in safari and permanently disables universal links from the device.
Universal links are complicated to debug and test.
Debugging a feature is an essential part of development. However, debugging universal links is a 7-step process involving configuring the web server, the native app project, and the developer portal. With many steps along the way, the chances of mistakes are increased. And even when there are several ways a universal link can break, Apple doesn’t have a validator tool to help with debugging.
This is a known Safari issue. Apple may randomly install a banner into your site in Saari when you enable universal links. You cannot control this, customize it or measure it. While most users just ignore this, it can be annoying.
Why allow apps to Link to your content?
Despite its limitations, allowing universal links has several benefits.
- Improve customer experienceUniversal links take the user straight to the in-app content instead of having the user install the app and then find the content they are looking for. By doing that, they create a seamless user experience.
- Increase app conversions.When users get to what they want right away, they are satisfied and happy users tend to make purchases. Therefore, the improved customer experience often leads to a boost in conversion rates.
- Increase retention rates.Finally, the improved experience results in higher user engagement and retention rates.
- Provide a secure path for users.
Universal links can prevent malicious actors from hijacking links and redirecting users to fraudulent applications.
Why a Universal Link Improves the performance of your app
Implementing universal links may take some time and effort to implement, but if you can do it, it will ultimately improve performance:
1. Universal links can fall back to the store if the app opening breaks
Universal links are a feature that can be used in conjunction with MMPs to redirect users to the App Store to prompt an app install if an app-open trigger fails to launch This is a big plus for mobile-first advertisers who want users to re-engage in their app. The user flow for universal links significantly improved from URL schemes and deep links where the user would have arrived at a dead-end when the URL scheme failed to respond.
While a fallback was also possible for URL schemes in the past, Apple has since removed that feature. Therefore, universal links are now the preferred method for redirecting users to an app from a website.
While having a mobile website is still beneficial for mobile-first advertisers, it is no longer required to redirect users to the App Store. Universal links have made it possible to redirect users directly to the App Store without needing a mobile website.
However, it is still recommended that advertisers have a mobile website to provide a better user experience and to attract potential customers who may not have the app installed yet.
- They are necessary for re-engaging users
When deep links bring the users back from an ad into your app, the links prompt a pop-up message on the user’s screen, impairing the user experience and performance. By directing the user straight to the app content, universal links prevent this.
- Improves re-attributions accuracy and decreases rejected re-attributions
A re-attribution is an association between a click and an open application such as the future in-app events happening after the click will be attributed to the advertising party that delivered that last click. If the app open happens after a given time frame, a mobile measurement partner usually rejects the reattribution. Because universal links create a smooth flow, the number of rejected re-attributions decreases.
What does a universal link look like?
Universal links look like regular HTTPS URLs. When the user clicks on it, the device opens the app in the content of the link directed to.
How do I set up Universal links for my app?
There are two basic steps:
- Set your app to register approved domains at the developer. Apple.com
- Configure your website so it can host an apple-app-site-association file.
Why don’t universal links sometimes work as tracking links?
Link-wrapping is not supported by universal linking, meaning you cannot wrap the link with a link redirect. Therefore, universal links sometimes fail as tracking links.
Is the universal link only on iOS?
Apple created these links protocols for launching apps on iOS from any website; therefore, are iOS-specific.
How do I reset my iOS for universal linking?
Long press on a universal link and it will take you to a message with an “open in `AppName`” option. Select the option to set opening the links in your app again.