Allowing Apps and Websites to Link to Your Content

Use universal links to link to content within your app and share data securely.


Universal links let you connect to content deep inside your app. Users open your app in a specified context, allowing them to accomplish their goals efficiently.

When users tap a universal link, iOS redirects the link directly to your app without routing through Safari or your website. In addition, because universal links are standard HTTP or HTTPS links, one URL works for both your website and your app. If your app is not installed, the system opens the URL in Safari, allowing your website to handle it.

When users install your app, iOS checks a file stored on your web server to verify that your website allows your app to open URLs on its behalf. Only you have the ability to store this file on your server, securing the association of your website and your app.

Support Universal Links

Take the following steps to support universal links:

  1. Create a two-way association between your app and your website and specify the URLs that your app handles, as described in Enabling Universal Links.

  2. Update your app delegate to respond to the user activity object iOS provides when a universal link routes to your app, as described in Handling Universal Links.

Universal links allow users to open your app when they tap links to your website within Safari and WKWebView, and links that result in a call to openURL:options:completionHandler:, such as those that occur in Mail, Messages, and other apps.

When a user browses your website in Safari and taps a universal link in the same domain, iOS opens that link in Safari, respecting the user’s most likely intent to continue within the browser. If the user taps a universal link in a different domain, iOS opens the link in your app.

Communicate with Other Apps

UIKit apps can communicate through universal links. Supporting universal links allows other apps to send small amounts of data directly to your app without using a third-party server. 

Define the parameters that your app handles within the URL query string. For example, a photo library app might specify parameters that include the name of an album and the index of a photo to display.

Listing 1

Examples of URLs with album name and photo index parameters

Other apps craft URLs based on your domain, path, and parameters, and ask your app to open them by calling the openURL:options:completionHandler: method of UIApplication. The calling app can ask the system to inform them when your app opens the URL.

Listing 2

An example of an app calling your universal link

if let appURL = URL(string: "") { { success in
        if success {
            print("The URL was delivered successfully.")
        } else {
            print("The URL failed to open.")
} else {
    print("Invalid URL specified.")

For more information on handling links within your app, see Handling Universal Links.


Universal Links

Enabling Universal Links

Configure your app and website to support universal links.

Handling Universal Links

Prepare your app to respond to an incoming universal link.

Custom URLs

Defining a Custom URL Scheme for Your App

Use specially formatted URLs to link to content within your app.