SDKsAndroid
API Reference
Complete Kotlin API reference for the WarpLink Android SDK.
WarpLink
The main entry point. Singleton object.
object WarpLinkProperties
| Property | Type | Description |
|---|---|---|
SDK_VERSION | String | The current SDK version ("0.1.0"). |
isConfigured | Boolean | Whether configure() has been called. Thread-safe. |
configure(context, apiKey, options)
fun configure(
context: Context,
apiKey: String,
options: WarpLinkOptions = WarpLinkOptions()
)Initialize the SDK. Must be called before any other SDK methods.
| Parameter | Type | Description |
|---|---|---|
context | Context | Android context (typically Application). Retains applicationContext. |
apiKey | String | Your WarpLink API key (wl_live_ or wl_test_ + 32 alphanumeric chars). |
options | WarpLinkOptions | Configuration overrides. |
Throws: WarpLinkError.InvalidApiKeyFormat if the key format is invalid.
handleDeepLink(uri, callback)
fun handleDeepLink(
uri: Uri,
callback: (Result<WarpLinkDeepLink>) -> Unit
)Resolve an incoming App Link URI to a deep link.
| Parameter | Type | Description |
|---|---|---|
uri | Uri | The App Link URI from intent?.data. |
callback | (Result<WarpLinkDeepLink>) -> Unit | Called on the main thread. |
Errors: NotConfigured, InvalidUrl, LinkNotFound, NetworkError, ServerError, InvalidApiKey, DecodingError
checkDeferredDeepLink(callback)
fun checkDeferredDeepLink(
callback: (Result<WarpLinkDeepLink?>) -> Unit
)Check for a deferred deep link on first launch. Returns null if no match found.
| Parameter | Type | Description |
|---|---|---|
callback | (Result<WarpLinkDeepLink?>) -> Unit | Called on the main thread. |
On first launch, reads Play Install Referrer then falls back to fingerprint matching. Subsequent launches return cached result.
Errors: NotConfigured, NetworkError, ServerError, InvalidApiKey, DecodingError
WarpLinkOptions
data class WarpLinkOptions(
val apiEndpoint: String = "https://api.warplink.app/v1",
val debugLogging: Boolean = false,
val matchWindowHours: Int = 72
)| Property | Type | Default | Description |
|---|---|---|---|
apiEndpoint | String | "https://api.warplink.app/v1" | API endpoint URL. |
debugLogging | Boolean | false | Enable WarpLink Logcat tag logging. |
matchWindowHours | Int | 72 | Match window for deferred attribution (hours). |
WarpLinkDeepLink
data class WarpLinkDeepLink(
val linkId: String,
val destination: String,
val deepLinkUrl: String? = null,
val customParams: Map<String, Any> = emptyMap(),
val isDeferred: Boolean = false,
val matchType: MatchType? = null,
val matchConfidence: Double? = null
)| Property | Type | Description |
|---|---|---|
linkId | String | Unique link identifier. |
destination | String | Resolved destination URL. |
deepLinkUrl | String? | Android-specific deep link URL (e.g., myapp://path). |
customParams | Map<String, Any> | Custom parameters on the link. |
isDeferred | Boolean | Whether resolved via deferred attribution. |
matchType | MatchType? | DETERMINISTIC or PROBABILISTIC. |
matchConfidence | Double? | Confidence score (0.0–1.0). |
MatchType
enum class MatchType {
DETERMINISTIC,
PROBABILISTIC
}| Value | Description |
|---|---|
DETERMINISTIC | Matched via Play Install Referrer. Confidence is always 1.0. |
PROBABILISTIC | Matched via enriched fingerprint. Confidence varies. |
WarpLinkError
sealed class WarpLinkError(
message: String,
cause: Throwable? = null
) : Exception(message, cause)| Subclass | Description |
|---|---|
NotConfigured | SDK used before configure(). |
InvalidApiKeyFormat | Key format invalid. Thrown by configure(). |
InvalidApiKey | Key rejected by server. |
NetworkError(cause) | Network request failed. |
ServerError(statusCode, message) | API error response. |
InvalidUrl | Not a recognized WarpLink domain. |
LinkNotFound | Link not found or inactive. |
DecodingError(cause) | Response parsing failed. |
Thread Safety
isConfiguredis thread-safe (protected bysynchronized)- All callbacks are dispatched to the main thread
configure()can be called from any thread but should be called once during initialization