WarpLink
SDKsAndroid

API Reference

The complete Kotlin API reference for the WarpLink Android SDK: initialization, deep link handling, and attribution methods.

The main entry point. Singleton object.

Properties

PropertyTypeDescription
SDK_VERSIONStringThe current SDK version ("1.1.0").
isConfiguredBooleanWhether configure() has been called. Thread-safe.

configure(context, apiKey, options)

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

ParameterTypeDescription
contextContextAndroid context (typically Application). Retains applicationContext.
apiKeyStringYour WarpLink SDK key (wl_live_ + 32 alphanumeric chars). Create it in the dashboard under API Keys > SDK key. An API key is rejected by install attribution.
optionsWarpLinkOptionsConfiguration overrides, including the onLink callback and opt-out flags.

Does not throw. A malformed key is not thrown: configure() logs a warning, dispatches WarpLinkError.InvalidApiKeyFormat to options.onLink (if set), and leaves the SDK unconfigured. This makes it safe to call from Application.onCreate().

When options.onLink is set, configure() auto-registers ActivityLifecycleCallbacks for cold-start handling and auto-fires the deferred deep link check. The single callback receives every resolved link (a tap or a deferred install match). Set automaticDeepLinks or automaticDeferredDeepLinks to false to disable either piece.

onNewIntent(intent)

Forward a warm-start intent to the SDK from your Activity's onNewIntent. The SDK resolves the link and dispatches to onLink. Required because Android delivers warm-start links through onNewIntent. Set android:launchMode="singleTask" on the Activity. A no-op when automaticDeepLinks is false.

handleDeepLink(uri, callback)

Resolve an incoming App Link URI to a deep link.

ParameterTypeDescription
uriUriThe App Link URI from intent?.data.
callback(Result<WarpLinkDeepLink>) -> UnitCalled on the main thread.

Errors: NotConfigured, InvalidUrl, LinkNotFound, NetworkError, ServerError, InvalidApiKey, DecodingError

checkDeferredDeepLink(callback)

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

ParameterTypeDescription
callback(Result<WarpLinkDeepLink?>) -> UnitCalled on the main thread.

On first launch, reads Play Install Referrer then falls back to fingerprint matching (device language + timezone offset, with the IP derived server-side). Subsequent launches return 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 Reinstall Persistence.

Errors: NotConfigured, NetworkError, ServerError, InvalidApiKey, DecodingError


WarpLinkOptions

PropertyTypeDefaultDescription
apiEndpointString"https://api.warplink.app/v1"API endpoint URL.
debugLoggingBooleanfalseEnable WarpLink Logcat tag logging.
automaticDeepLinksBooleantrueAuto-register cold-start handling and resolve forwarded intents.
automaticDeferredDeepLinksBooleantrueAuto-run the deferred deep link check on first launch.
linkDomainsList<String>emptyList()Extra hosts the SDK should treat as yours, for links served from a custom domain.
onLink((Result<WarpLinkDeepLink>) -> Unit)?nullSingle 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 manifest meta-data

linkDomains is additive, never a replacement. The SDK recognizes the union of aplnk.to, linkDomains, the comma separated app.warplink.DOMAINS meta-data in AndroidManifest.xml, and the domains returned by /sdk/validate. The first three are known synchronously at configure(), so a launch intent on a custom domain is claimed 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 Uri.getHost() never carries one. Empty entries are dropped. A www. prefix is preserved, since it is a different host.


PropertyTypeDescription
linkIdStringUnique link identifier.
destinationStringResolved destination URL.
deepLinkUrlString?Android-specific deep link URL (e.g., myapp://path).
customParamsMap<String, Any>Custom parameters on the link.
isDeferredBooleanWhether resolved via deferred attribution.
matchTypeMatchType?DETERMINISTIC or PROBABILISTIC.
matchConfidenceDouble?Confidence score (0.0–1.0). Useful for reporting, not for a trust decision.
matchGuaranteedBooleanTrue only for a deterministic match. Gate anything sensitive (auto sign-in, showing personal data) on this rather than on a confidence threshold.

MatchType

ValueDescription
DETERMINISTICMatched via Play Install Referrer. Confidence is always 1.0.
PROBABILISTICMatched via enriched fingerprint. Confidence varies.

WarpLinkError

SubclassDescription
NotConfiguredSDK used before configure().
InvalidApiKeyFormatKey format invalid. Reported to onLink by configure().
InvalidApiKeyKey rejected by server.
NetworkError(cause)Network request failed.
ServerError(statusCode, message)API error response.
InvalidUrlNot a recognized WarpLink domain.
LinkNotFoundLink not found or inactive.
DecodingError(cause)Response parsing failed.

Thread Safety

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

On this page