Deferred deep linking allows users who don’t have your app installed to click an Adjust link, install your app from the App Store, and then be directed to their intended content when they first open the app.
How it works
This is the basic flow of deferred deep linking:
The user clicks on an Adjust deep link.
Adjust’s servers redirect the user to the App Store.
The user installs your app and opens it.
Adjust’s servers perform attribution and send the deep link to the Adjust SDK.
If applicable, your app displays its initial screens, such as onboarding screens and user login.
The Adjust SDK delivers the deferred deep link to your app. Your app then handles this link to direct the user to the appropriate screen. (The exact mechanism for this step depends on your setup, as described below.)
Deferred deep link format
When a user clicks an Adjust branded link (brandname.go.link) and the link is deferred, Adjust’s servers convert it to app scheme format (example://), using the app scheme configured in the iOS platform settings in the Adjust dashboard, before passing it to the SDK.
As a result, you should configure your app to handle Adjust branded links and app scheme deep links in the same way. For example, both of the following links should open the same screen:
// (for example, store deep link or handle it immediately)
4
5
returnfalse// or true based on your use case (see below)
6
}
1
- (BOOL)adjustDeeplinkResponse:(NSURL*)deeplink {
2
// TODO: Handle deeplink
3
// (for example, store deep link or handle it immediately)
4
5
returnNO; // or YES based on your use case (see below)
6
}
Return Value Options
The return value of adjustDeeplinkResponse determines what happens after your callback code executes:
Return false (most common)
Use this approach if you want your app to have complete control over when and how to process the deferred deep link. By returning false, the Adjust SDK will not attempt to open the deferred deep link. For example, this approach is appropriate if your app needs to show and move past initial screens (like onboarding or login) before handling the deferred deep link.
Return true
Use this approach if you want the Adjust SDK to attempt to open the deferred deep link immediately after the callback code runs. For example, this approach is appropriate if your app does not have any initial screens.
When the Adjust SDK receives the deferred deep link, your callback code runs, and then the Adjust SDK calls application(_:open:options:) with the deferred deep link, which iOS then routes to the appropriate handler based on your app setup:
App Implementation
Handler
UIKit using AppDelegate
application(_:open:options:)
UIKit using SceneDelegate
scene(_:openURLContexts:)
SwiftUI
.onOpenURL modifier
To handle the deep link from the appropriate handler above, ensure that you have already implemented direct deep linking.
Full code example
This example shows an app that has an onboarding process that has to complete before the app can handle deferred deep links. Here is a summary of how the example code works.
A user who doesn’t have the app installed clicks an Adjust deep link, which
redirects them to the app store.
The user installs and opens the app.
The Adjust SDK sends session and attribution requests to Adjust’s servers.
The app begins its onboarding process.
Adjust’s servers respond with attribution data, including the deep link the
user clicked on (“deferred deep link”).
The Adjust SDK triggers a deferred deep link callback in the app (shown in AppDelegate below). The callback checks whether onboarding is
complete:
If onboarding is complete, it handles the deep link immediately.
If onboarding isn’t complete, it stores the deep link.
Once onboarding completes, the app checks for and handles any stored deferred
deep link (shown in the ViewController and ContentView examples below).
The app navigates the user to the deep link screen.
AppDelegate
Deferred deep linking updates to AppDelegate are in the highlighted code. This example is applicable to both the UIKit and SwiftUI examples.