Skip to main content
Documentation
SDKsiOS

iOS Deferred Deep Links

Preserve a link's destination through an App Store install, then route the user on first launch, with the WarpLink iOS SDK.

Deferred deep links let you route users to specific content even when they don't have your app installed. The user clicks a link, installs from the App Store, and on first launch the SDK matches them back to the original link.

How It Works

  1. User taps a WarpLink URL in Safari
  2. WarpLink's redirect page records the click. The server derives the IP and stores it with the normalized language and timezone. Clicks that share a match key are kept as a list, newest first, up to 10, so a second click never overwrites the first
  3. User is redirected to the App Store
  4. User installs and opens the app
  5. SDK detects first launch. The completion marker is written only after the check completes, so a failed check is tried again on a later launch. From SDK 1.4.0, it waits before it tries again, and the first launch never waits. The marker lives in a backup-excluded file inside the app container, so it goes away with the app and does not come back from an iCloud or iTunes restore.
  6. SDK collects device signals (preferred language, timezone name and offset, IDFV)
  7. SDK sends signals to the attribution API. The server derives the IP from the request and computes the match key
  8. Server matches against stored click data and returns the deep link

On iPhone, the App Store passes the app no link, so the check can only estimate. Tether closes that gap: the app reads a short code from the clipboard and gets the exact link. Pick when the SDK reads it in SDK read modes.

Automatic Check

The deferred check fires automatically from configure(). The result arrives in your onLink callback, where isDeferred is true. navigateTo(_:), showWelcome(suggestedContent:) and showOnboarding() in the samples on this page stand for your own code:

If the device has no network on launch, the SDK checks again on a later launch by itself. From SDK 1.4.0, it waits before it tries again, and the first launch never waits. The waits are listed under Caching Behavior.

Manual Check (Advanced)

To run the check yourself, set autoDeferredCheck: false in WarpLinkOptions and call checkDeferredDeepLink early in your first-launch flow:

Confidence-Based Routing

Confidence Scores

Probabilistic scores depend on the match key variant. enriched_tz hashes the IANA timezone name and is what an SDK that collects a zone name sends. enriched hashes the minute offset instead and stays as the fallback for older SDKs. basic drops the timezone entirely.

ScenarioConfidenceMatch Type
Referral invitation token, pasted by the person1.0deterministic
IDFV repeat check, same install asking again (not a reinstall)The stored install's own scoreThe stored install's own type
enriched_tz match key, < 1 hour0.85probabilistic
enriched_tz match key, < 3 hours0.65probabilistic
enriched_tz match key, < 6 hours0.50probabilistic
enriched_tz match key, < 24 hours0.30probabilistic

The offset variant scores 0.80 / 0.60 / 0.45 / 0.25 across the same bands, and basic scores 0.70 / 0.50 / 0.35 / 0.20. Two further signals adjust the score: more than one distinct link in the match key bucket applies x0.6, and a shared click IP applies x0.6 for carrier-grade NAT or a private address, x0.9 for a household IPv4 address, and x1.0 for IPv6. Past 24 hours there is no match at all.

Recommendation: Route to specific content when matchConfidence > 0.5. Show generic onboarding below 0.5. Route a probabilistic match to content or a sign-in screen, and keep sign-in on your own authentication.

Match Window

The match window controls how far back the server looks for matching clicks. It is set per link on the server, not in the SDK. Configure it in the dashboard when you create or edit a link. The default is 6 hours and the maximum is 24 hours.

The window is deliberately short so the match key bucket stays tight and matches stay precise. Links created before the current limits may still carry a longer stored value, but the server caps every window at 24 hours when it reads them.

This governs probabilistic matching only. An IDFV repeat check is not affected by the window, because it returns an install the device already has.

Caching Behavior

  • The SDK checks for a deferred deep link only on first launch
  • Once the check completes, a completion marker is recorded so it does not run again for this install
  • Subsequent launches return without another network request
  • An attempt that produced no usable answer (offline, an error, or a match the SDK cannot route to a destination) is not recorded as complete, so a later launch tries again. SDK 1.3.0 and earlier try again on the next launch
  • From SDK 1.4.0, a failed check waits before it tries again, and old installs are limited:
    • The wait is 15 minutes after the first failure, 1 hour after the second, 6 hours after the third, and 24 hours after every failure after that. The SDK stops 3 days after the first failure
    • While a wait runs, checkDeferredDeepLink sends no request and returns .success(nil), the same answer as no match. WarpLink.isAttributionComplete stays false, so a skipped check does not look finished. WarpLink.deferredCheckStatus tells you which case you have. The check starts only while your app is in the foreground. A call made while the app is in the background waits until the app comes to the foreground, and then runs
    • An install older than 30 days is not checked. An install older than 48 hours is checked without language and timezone signals, so a match can come only from an exact method such as the IDFV repeat check or a Tether code
    • A wl_test_ key has no waits and no age limits, so you can test a first launch as often as you like
  • A reinstall is a new install, so it gets a new check. See App Reinstall

Edge Cases

Offline First Launch

If the device has no connectivity on first launch, checkDeferredDeepLink fails with .networkError. The attempt is not consumed. The SDK tries the check again on a later launch. From SDK 1.4.0, it waits before it tries again, as listed under Caching Behavior.

If connectivity is critical for first-launch, check for network availability before calling checkDeferredDeepLink.

App Reinstall

A reinstall is a new install and is attributed again. The SDK keeps two markers with two different jobs:

  • Completion marker: a backup-excluded file in the app container. It says the check already ran for this install. Deleting the app deletes it, and an iCloud or iTunes restore does not bring it back, so a reinstall starts clean.
  • Device-seen marker: a Keychain item. It says the device was attributed at some point, and it outlives an app delete. It gates nothing. Its only job is to set is_reinstall: true on the attribution request, so the install is recorded as a reinstall rather than a first install

Both installs count. The dashboard shows installs and reinstalls together as one installs number.

Routing-only mode

If the app is in routing-only mode, the server skips the probabilistic match. Deep links still open the app. No SDK change is needed.

Clicks that share a match key are kept as a list, newest first, up to 10. The most recent click your app can claim is the one matched, and the others stay available for the other devices that share the address. When more than one click is claimable, the confidence score is multiplied by 0.6 to report that ambiguity.

Referral Invitation

A referral link adds a step the automatic check does not do on its own. On iPhone the install carries no data, so the person pastes the invitation with WarpLinkPasteButton (or WarpLinkUIPasteButton) and the SDK matches it with redeemInvitation. A match is cached as attributionResult, and a match that a network failure delayed is delivered to onLink on a later launch. Skipping the paste leaves the check as it is. See Referral Invitations. The referrals guide covers the whole path.

Testing

Deleting the app is enough to retest. The completion marker goes with it, so the next install runs the check again:

  1. Delete the app from the test device
  2. Open the test link in Safari. You'll be redirected to the App Store (or fallback URL)
  3. Install the app via Xcode or TestFlight
  4. Launch the app. The match arrives in onLink

The request from step 4 carries is_reinstall: true, because the Keychain marker from the earlier install is still on the device. To test the first-install path instead, erase the device: on a simulator use Device > Erase All Content and Settings (or xcrun simctl erase), which clears the Keychain along with everything else, and on a physical device use one that has never run the app.

If your test did not match

Use a wl_test_ key and a link from your Test app while you build: a Test key has no waits and no age limits. Tap the link again before every install: one tap matches one install.

If a test still shows no link, read the status of the check:

Read it after the check ends, for example from a debug button, or watch for the Deferred check: <state> log line. Right after configure, it reads the check as still running.

WarpLink.deferredCheckStatus is a DeferredCheckStatus. It sends no request, and it comes from what the SDK stored, so a relaunch keeps it.

StateWhat it means
.notCheckedNo check has finished for this install. A failed check whose wait has passed also reads .notChecked.
.checkingA check is running, or waiting for the app to come to the foreground.
.matchedThe check found a link.
.noMatchThe check finished and the server found no link.
.waiting(retryAt:)An earlier check failed. The SDK sends nothing before the Date in retryAt.
.skippedOldInstallThe install is older than 30 days. No request is sent.
.stoppedThe SDK gave up 3 days after the first failure. No request is sent.

A wl_test_ key never reports .waiting, .skippedOldInstall or .stopped. These causes give no link:

  • The link and the key are from different environments. A wl_test_ key matches only taps on links of your Test app, at <handle>-test.aplnk.to. A wl_live_ key matches only Production links. Create the test link in Test, and tap that link.
  • A wait is running. The first launch never waits. A check counts as failed from the moment its request is sent, so stopping the app in Xcode while the request is out starts a 15-minute wait. Use a wl_test_ key, or wait until retryAt.
  • The install is too old. With a wl_live_ key, an install older than 48 hours is checked without language and timezone, so it usually reads .noMatch. An install older than 30 days is not checked and reads .skippedOldInstall. Xcode keeps the app container when it runs the app again, so the install age keeps counting. Delete the app to start the age and the waits over.
  • The click was used. A click matches one install. Tap the link again before the next install.
  • The click is too old. The match window is 6 hours by default. See Match Window.

With debugLogging: true, each request prints [WarpLink] Deferred check request: attempt <n>, raw signals <yes|no>, and each check ends with [WarpLink] Deferred check: <state>. A waiting check prints Deferred check: waiting, retry at <ISO 8601 time>.