Skip to main content
Documentation
SDKsiOS

iOS API Reference

The complete Swift API reference for the WarpLink iOS SDK: initialization, deep link handling, and attribution methods, with signatures and examples.

The main entry point. All methods are static.

Properties

PropertyTypeDescription
sdkVersionStringThe current SDK version ("1.1.1").
isConfiguredBoolWhether configure() has been called. Thread-safe.
isApiKeyValidBool?The server's key validation verdict: true, false (rejected or revoked), or nil if not yet determined.
attributionResultWarpLinkDeepLink?The cached result of the last deferred deep link check.
isAttributionCompleteBoolWhether the deferred attribution check has finished for this install.

configure(apiKey:options:)

Initialize the SDK. Must be called before any other SDK methods.

ParameterTypeDescription
apiKeyStringYour WarpLink SDK key (wl_live_ + 32 alphanumeric chars). Create it in the dashboard under Keys > SDK keys. An API key is rejected by install attribution.
optionsWarpLinkOptions?Optional configuration overrides, including the onLink callback and opt-out flags.

Validates the key format locally, then performs async server-side validation via /sdk/validate. The validation result is cached for 24 hours.

When options.onLink is set, configure() also wires up cold start, warm start, and the deferred deep link check. The single callback receives every resolved link (a tap or a deferred install match). Set autoDeepLinkHandling or autoDeferredCheck to false to disable either piece and drive it with the manual methods below.

continue(_:) and open(_:)

Forward an incoming Universal Link to the SDK from your scene or app delegate. The SDK resolves it and dispatches to onLink. Use these when you keep your own delegate instead of the drop-in WarpLinkSceneDelegate / WarpLinkAppDelegate. continue(_:) extracts webpageURL and forwards it to open(_:).

Both return true if the URL was a WarpLink link the SDK will handle: a WarpLink domain and a path of exactly one segment, which is what a slug always is. A custom domain counts as a WarpLink domain once you declare it in linkDomains or WarpLinkDomains. They return false (and do nothing) when configure() has not run, when autoDeepLinkHandling is disabled, when the URL is not on a WarpLink domain, or when the path is not a single segment. By default your app is associated with every path on the domain, so pass every URL here and route the ones that return false with your own router.

isWarpLinkURL(_:)

Check whether a URL is a WarpLink link, without resolving it. Useful when a host has its own router and needs to decide whether to hand a URL to WarpLink at all, since open(_:) and continue(_:) resolve as a side effect (claiming the tap, deduping, calling the API). Uses the same WarpLink domain and single-path-segment rule as open(_:)/continue(_:).

ParameterTypeDescription
urlURLThe URL to check.

Resolve an incoming Universal Link URL to a deep link.

ParameterTypeDescription
urlURLThe Universal Link URL received by the app.
completion(Result<WarpLinkDeepLink, WarpLinkError>) -> VoidCalled on the main thread.

Errors: .notConfigured, .invalidURL, .linkNotFound, .passwordRequired, .networkError, .serverError, .invalidApiKey, .decodingError

checkDeferredDeepLink(completion:)

Check for a deferred deep link on first launch. Returns nil if no match found. Called automatically by configure() unless autoDeferredCheck is false.

ParameterTypeDescription
completion(Result<WarpLinkDeepLink?, WarpLinkError>) -> VoidCalled on the main thread.

On first launch, collects device signals (preferred language, timezone offset, IDFV) and sends them to the attribution API. The server derives the IP and computes the match key. On subsequent launches, returns the cached result.

"First launch" means the first launch of the current install. A reinstall is a new install and runs the check again, with is_reinstall set on the request. See App Reinstall.

Errors: .notConfigured, .networkError, .serverError, .invalidApiKey, .decodingError


WarpLinkOptions

PropertyTypeDefaultDescription
apiEndpointString"https://api.warplink.app/v1"API endpoint URL.
debugLoggingBoolfalseEnable [WarpLink] console logging.
autoDeepLinkHandlingBooltrueAutomatically resolve forwarded Universal Links and dispatch to onLink.
autoDeferredCheckBooltrueAutomatically run the deferred deep link check on first launch.
linkDomains[String][]Extra hosts the SDK should treat as yours, for links served from a custom domain.
onLink((Result<WarpLinkDeepLink?, WarpLinkError>) -> Void)?nilSingle callback for cold start, warm start, and deferred results. Disambiguate with isDeferred.

The match window is server-side (set per link in the dashboard), so there is no matchWindowHours option.

linkDomains and the WarpLinkDomains plist key

linkDomains is additive, never a replacement. The SDK recognizes the union of aplnk.to, linkDomains, the WarpLinkDomains string array in Info.plist, and the domains returned by /sdk/validate. The first three are known synchronously at configure(), so open(_:) claims a custom-domain link on the first launch instead of waiting for the server.

Entries are normalized: trimmed, lowercased, and reduced to a host if a full URL is given. A port is dropped, because the host of an incoming URL never carries one. Empty entries are dropped. A www. prefix is preserved, since it is a different host.

WarpLinkDomains is an array of strings. A single comma separated string is accepted too, because that is the row type Xcode's plist editor creates by default.


PropertyTypeDescription
linkIdStringUnique link identifier.
destinationStringResolved destination URL.
deepLinkUrlString?iOS-specific deep link URL (e.g., myapp://path).
customParams[String: JSONValue]The query parameters of the link's destination URL on a direct open, empty on a deferred match. Read values with the typed accessors (.stringValue, .intValue, .doubleValue, .boolValue).
isDeferredBoolWhether resolved via deferred attribution.
matchTypeMatchType?.deterministic or .probabilistic.
matchConfidenceDouble?Confidence score (0.0–1.0). Use it for reporting.
matchGuaranteedBoolTrue only for a deterministic match. Use it to pick a destination, and keep sign-in on your own authentication.

Access custom params with the typed accessors:


JSONValue

The value type of customParams, which the API returns as a JSON object. Read a value with its typed accessor rather than switching on the enum cases directly.

AccessorTypeDescription
stringValueString?The value if it is a JSON string.
intValueInt?The value if it is a JSON number representable as an Int.
doubleValueDouble?The value if it is a JSON number.
boolValueBool?The value if it is a JSON boolean.
arrayValue[JSONValue]?The value if it is a JSON array.
objectValue[String: JSONValue]?The value if it is a JSON object.
foundationValueAnyThe value lowered to a Foundation/JSON object graph (String/Int/Double/Bool/[String: Any]/[Any]/NSNull).

MatchType

CaseDescription
.deterministicResolved straight from a tapped link, or matched by the Play Install Referrer on Android. Confidence is always 1.0. A deferred install on iOS is never deterministic.
.probabilisticMatched via enriched match key.

WarpLinkError

CaseDescription
.notConfiguredSDK used before configure().
.invalidApiKeyFormatKey format invalid (wl_live_ + 32 chars).
.invalidApiKeyKey rejected by server.
.networkError(Error)Network request failed.
.serverError(statusCode: Int, message: String)API error response.
.invalidURLNot a recognized WarpLink domain.
.linkNotFoundLink not found or inactive.
.passwordRequiredLink is password protected, so it resolves to no destination and no platform URLs.
.decodingError(Error)Response parsing failed.

WarpLinkAppDelegate

Drop-in UIApplicationDelegate that forwards Universal Links to WarpLink. Use it directly, or subclass it and copy the two forwarding calls into your own delegate. No method swizzling is performed.

MemberDescription
application(_:continue:restorationHandler:)Forwards the incoming NSUserActivity to WarpLink.continue(_:).
application(_:open:options:)Forwards the incoming URL to WarpLink.open(_:).

WarpLinkSceneDelegate

Drop-in UIWindowSceneDelegate that forwards Universal Links to WarpLink, covering cold launch, warm continue, and URL contexts.

MemberDescription
windowUIWindow?, the scene's window.
scene(_:willConnectTo:options:)Forwards the connection options' user activities and URL contexts to WarpLink.continue(_:) and WarpLink.open(_:) on cold launch.
scene(_:continue:)Forwards the incoming NSUserActivity to WarpLink.continue(_:) on warm continue.
scene(_:openURLContexts:)Forwards each incoming URL context to WarpLink.open(_:).

Thread Safety

  • isConfigured is thread-safe (protected by NSLock)
  • All completion handlers are dispatched to the main thread
  • configure() can be called from any thread but should be called once during initialization