adjust-icon

Set up direct deep linking

You can configure deep linking in your app after you have set it up in the Adjust dashboard. Direct deep linking occurs when a user has your app installed on their device. The link takes the user to a specific page within your app.

To enable deep linking, you need to do the following:

  • Enable Associated Domains for your app
  • Configure your deep links in Xcode

Enable Associated Domains

To get started, you need to enable Associated Domains in your Apple Developer account. This allows you to set universal link domains in your app. To do this, follow these steps:

  1. Log in to your Apple Developer account.
  2. Select Certificates, IDs & Profiles in the left-hand menu.
  3. Select Identifiers in the left-hand menu.
  4. Find your app and select it to open the edit page.
  5. Ensure that Associated Domains is checked under Capabilities.
  6. Select Save to save your changes.

Follow these steps to add your deep link configuration to your Xcode project.

  1. Open your app project in Xcode.
  2. Select your project from the left-hand menu.
  3. Select your app under Targets.
  4. Select Signing & Capabilities from the top menu.
  5. Ensure that All is selected in the submenu below.
  6. Select the Add option (+) to add a capability.
  7. Select Associated Domains.
  8. Enter the Adjust Universal Link domain with the prefix applinks:
    • Here is an example using the example.adj.st domain: applinks:example.adj.st.

Custom URL scheme

  1. Open your app project in Xcode.
  2. Select your project from the left-hand menu.
  3. Select your app under Targets.
  4. Select Info from the top menu.
  5. Expand the URL Types section.
  6. Select the Add option (+) to add a URL type.
  7. Fill in the following information to create a URL scheme:
    • Identifier: $(PRODUCT_BUNDLE_IDENTIFIER)
    • URL Schemes: Your custom URL scheme. This must be unique. Don’t use protected schemes such as http, https, or mailto.
    • Role: Editor

This scheme will work for your production and debug builds.

Modify your iOS app

You need to update your iOS app to set up different deep linking scenarios. How you update your app depends on whether your app uses scenes.

App doesn’t use scenes

If your app doesn’t uses scenes, you need to update methods in your app delegate.

Update the application(_:continue:restorationHandler:) method in your app delegate to call the following methods in the Adjust SDK:

  • ADJLinkResolution.resolveLink: Call this method only if your marketing team requires the use of Adjust’s Link Resolution solution. If the deep link uses a domain that matches an element in the resolveUrlSuffixArray, then the method attempts to resolve the deep link, and returns the resolved link. If the deep link doesn’t match an element in this array, then the method passes through the original deep link, so you can pass all deep links to this method.
  • Adjust.appWillOpen - Call this method to send deep links to Adjust’s servers to record information. You can pass both Adjust and non-Adjust deep links to this method. Adjust’s servers will ignore any deep links that don’t have Adjust parameters.

When a user clicks on your universal link, iOS opens your app and delivers the deep link to application(_:continue:restorationHandler:). This occurs whether the user has closed your app or has it running in the background.

Custom URL scheme

If your marketing team requires you to set up custom URL scheme deep links, update the application(_:open:options:) method in your app delegate to call the Adjust.appWillOpen method in the Adjust SDK. This method sends deep links to Adjust’s servers to record them. You can pass both Adjust and non-Adjust deep links to this method. Adjust’s servers ignore any deep links that don’t have Adjust parameters.

When a user clicks on your custom URL scheme deep link, iOS opens your app and delivers the deep link to application(_:open:options:). This occurs whether the user has closed your app or has it running in the background.

App uses scenes

If your app uses scenes, you need to update methods in your scene delegate.

  1. Update the scene(_:willConnectTo:options:) method in your scene delegate. When a user clicks on your universal links and the user has your app closed, iOS opens your app and delivers the deep link to this method.
  2. Update the scene(_:continue:) method in your scene delegate. When a user clicks on your universal links, and the user has your app running in the background, iOS opens your app and delivers the deep link to this method.

The above methods call the following methods in the Adjust SDK:

  • ADJLinkResolution.resolveLink: Call this method only if your marketing team requires the use of Adjust’s Link Resolution solution. If the deep link uses a domain that matches an element in the resolveUrlSuffixArray, then the method attempts to resolve the deep link, and returns the resolved link. If the deep link doesn’t match an element in this array, then the method passes through the original deep link, so you can pass all deep links to this method.
  • Adjust.appWillOpen - Call this method to send deep links to Adjust’s servers to record them. You can pass both Adjust and non-Adjust deep links to this method. Adjust’s servers ignore any deep links that don’t have Adjust parameters.

Custom URL scheme

  1. Update the scene(_:willConnectTo:options:) method in your scene delegate. When a user clicks on your custom URL scheme deep link and the user has your app closed, iOS opens your app and delivers the deep link to this method.
  2. Update the scene(_:openURLContexts:) method in your scene delegate. When a user clicks on your custom URL scheme deep link, and the user has your app running in the background, iOS opens your app and delivers the deep link to this method.

These methods call the Adjust.appWillOpen method in the Adjust SDK. This method sends deep links to Adjust’s servers to recordd them. You can pass both Adjust and non-Adjust deep links to this method. Adjust’s servers ignore any deep links that don’t have Adjust parameters.