Skip to main content
Documentation
SDKsAndroid

Android 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.1").
isConfiguredBooleanWhether configure() has been called. Thread-safe.
attributionResultWarpLinkDeepLink?The cached result of the last deferred deep link check, or null if none.

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 Keys > SDK keys. 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().

The deferred deep link check fires on first launch whenever automaticDeferredDeepLinks is true (the default), with or without onLink set: the SDK still calls the attribution API and records the install. options.onLink only gates delivery of the result and cold-start handling. When options.onLink is set, configure() also auto-registers ActivityLifecycleCallbacks for cold-start handling, and the deferred check's result is dispatched to it. 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.

isWarpLinkUri(uri)

Check whether a URI is a WarpLink link, without resolving it. Useful when a host has its own router and needs to decide whether to hand a URI to WarpLink at all, since handleDeepLink resolves it as a side effect (claiming the tap, deduping, calling the API).

ParameterTypeDescription
uriUriThe URI to check.

Before configure(), the known domain set is aplnk.to alone. A link on a custom domain reads as false until it is declared via linkDomains, the app.warplink.DOMAINS manifest meta-data, or /sdk/validate has returned it.

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, PasswordRequired, 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 probabilistic 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 App Reinstall.

Errors: NotConfigured, NetworkError, ServerError, InvalidApiKey, DecodingError

isAttributionComplete()

Whether the deferred attribution check has definitively completed for this install. Returns false before configure() runs or before the check completes. The React Native bridge reads this so a deferred match reaches onLink at most once across launches, matching the native auto-dispatch guard.


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>The query parameters of the link's destination URL on a direct open, empty on a deferred match.
isDeferredBooleanWhether resolved via deferred attribution.
matchTypeMatchType?DETERMINISTIC or PROBABILISTIC.
matchConfidenceDouble?Confidence score (0.0–1.0).
matchGuaranteedBooleanTrue only for a deterministic match. Use it to pick a destination, and keep sign-in on your own authentication.

MatchType

ValueDescription
DETERMINISTICMatched via Play Install Referrer. Confidence is always 1.0.
PROBABILISTICMatched via enriched match key. 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.
PasswordRequiredLink is password protected, so it resolves to no destination and no platform URLs.
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