WarpLink
SDKsiOS

API Reference

Complete Swift API reference for the WarpLink iOS SDK.

The main entry point. All methods are static.

public final class WarpLink

Properties

PropertyTypeDescription
sdkVersionStringThe current SDK version ("0.1.0").
isConfiguredBoolWhether configure() has been called. Thread-safe.

configure(apiKey:options:)

public static func configure(
    apiKey: String,
    options: WarpLinkOptions? = nil
)

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

ParameterTypeDescription
apiKeyStringYour WarpLink API key (wl_live_ or wl_test_ + 32 alphanumeric chars).
optionsWarpLinkOptions?Optional configuration overrides.

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

public static func handleDeepLink(
    _ url: URL,
    completion: @escaping (Result<WarpLinkDeepLink, WarpLinkError>) -> Void
)

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, .networkError, .serverError, .invalidApiKey, .decodingError

checkDeferredDeepLink(completion:)

public static func checkDeferredDeepLink(
    completion: @escaping (Result<WarpLinkDeepLink?, WarpLinkError>) -> Void
)

Check for a deferred deep link on first launch. Returns nil if no match found.

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

On first launch, collects device signals and sends them to the attribution API. On subsequent launches, returns the cached result.

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


WarpLinkOptions

public struct WarpLinkOptions: Sendable
PropertyTypeDefaultDescription
apiEndpointString"https://api.warplink.app/v1"API endpoint URL.
debugLoggingBoolfalseEnable [WarpLink] console logging.
matchWindowHoursInt72Match window for deferred attribution (hours).

public struct WarpLinkDeepLink
PropertyTypeDescription
linkIdStringUnique link identifier.
destinationStringResolved destination URL.
deepLinkUrlString?iOS-specific deep link URL (e.g., myapp://path).
customParams[String: Any]Custom parameters on the link.
isDeferredBoolWhether resolved via deferred attribution.
matchTypeMatchType?.deterministic or .probabilistic.
matchConfidenceDouble?Confidence score (0.0–1.0).

Access custom params with safe casting:

if let productId = deepLink.customParams["product_id"] as? String {
    showProduct(id: productId)
}

MatchType

public enum MatchType: String, Codable, Sendable
CaseDescription
.deterministicMatched via IDFV. Confidence is always 1.0.
.probabilisticMatched via enriched fingerprint. Confidence varies.

WarpLinkError

public enum WarpLinkError: Error, LocalizedError
CaseDescription
.notConfiguredSDK used before configure().
.invalidApiKeyFormatKey format invalid (wl_live_/wl_test_ + 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.
.decodingError(Error)Response parsing failed.

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

On this page