Use universal links to link to content within your app and share data securely.
You can connect to content deep inside your app with universal links. Users open your app in a specified context, allowing them to accomplish their goals efficiently.
When users tap or click a universal link, the system 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 the user has not installed your app, the system opens the URL in Safari, allowing your website to handle it.
When users install your app, the system 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:
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.
Update your app delegate to respond to the user activity object the system provides when a universal link routes to your app, as described in Handling Universal Links.
With universal links, users open your app when they tap links to your website within Safari and
WKWeb, and links that result in a call to
open(_: in iOS and tvOS or a call to
open(_: in macOS, 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, the system 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, the system opens the link in your app.
Communicate with Other Apps
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.
Other apps craft URLs based on your domain, path, and parameters, and ask your app to open them by calling the
open(_: method of
UIApplication in iOS and tvOS, or the
open(_: method of
NSWorkspace in macOS. The calling app can ask the system to inform them when your app opens the URL.
For more information on handling links within your app, see Handling Universal Links.