API Reference
Complete Swift API reference for the WarpLink iOS SDK.
WarpLink
The main entry point. All methods are static.
public final class WarpLinkProperties
| Property | Type | Description |
|---|---|---|
sdkVersion | String | The current SDK version ("0.1.0"). |
isConfigured | Bool | Whether 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.
| Parameter | Type | Description |
|---|---|---|
apiKey | String | Your WarpLink API key (wl_live_ or wl_test_ + 32 alphanumeric chars). |
options | WarpLinkOptions? | 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.
handleDeepLink(_:completion:)
public static func handleDeepLink(
_ url: URL,
completion: @escaping (Result<WarpLinkDeepLink, WarpLinkError>) -> Void
)Resolve an incoming Universal Link URL to a deep link.
| Parameter | Type | Description |
|---|---|---|
url | URL | The Universal Link URL received by the app. |
completion | (Result<WarpLinkDeepLink, WarpLinkError>) -> Void | Called 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.
| Parameter | Type | Description |
|---|---|---|
completion | (Result<WarpLinkDeepLink?, WarpLinkError>) -> Void | Called 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| Property | Type | Default | Description |
|---|---|---|---|
apiEndpoint | String | "https://api.warplink.app/v1" | API endpoint URL. |
debugLogging | Bool | false | Enable [WarpLink] console logging. |
matchWindowHours | Int | 72 | Match window for deferred attribution (hours). |
WarpLinkDeepLink
public struct WarpLinkDeepLink| Property | Type | Description |
|---|---|---|
linkId | String | Unique link identifier. |
destination | String | Resolved destination URL. |
deepLinkUrl | String? | iOS-specific deep link URL (e.g., myapp://path). |
customParams | [String: Any] | Custom parameters on the link. |
isDeferred | Bool | Whether resolved via deferred attribution. |
matchType | MatchType? | .deterministic or .probabilistic. |
matchConfidence | Double? | 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| Case | Description |
|---|---|
.deterministic | Matched via IDFV. Confidence is always 1.0. |
.probabilistic | Matched via enriched fingerprint. Confidence varies. |
WarpLinkError
public enum WarpLinkError: Error, LocalizedError| Case | Description |
|---|---|
.notConfigured | SDK used before configure(). |
.invalidApiKeyFormat | Key format invalid (wl_live_/wl_test_ + 32 chars). |
.invalidApiKey | Key rejected by server. |
.networkError(Error) | Network request failed. |
.serverError(statusCode: Int, message: String) | API error response. |
.invalidURL | Not a recognized WarpLink domain. |
.linkNotFound | Link not found or inactive. |
.decodingError(Error) | Response parsing failed. |
Thread Safety
isConfiguredis thread-safe (protected byNSLock)- All completion handlers are dispatched to the main thread
configure()can be called from any thread but should be called once during initialization