LinkSense
Use casesFeaturesPricingDocs
Sign inStart free
Start free
LinkSense

Campaign links that open your app. Or the store.

Product

  • Use cases
  • Features
  • Pricing
  • Documentation
  • QR Code Generator

Compare

  • Firebase Dynamic Links
  • vs Dynalinks
  • vs LinkHopp
  • vs Branch

Company

  • About
  • Contact
  • Privacy
  • Terms
  • Refund Policy
  • Cookie Policy

Support

  • Help Center
  • Report abuse
Featured on Product HuntLinkSense — Featured on Smol LaunchLinkSense — Featured on Smol LaunchLinkSense — Featured on FazierLinkSense — Featured on FazierLaunched onTiny StartupsLinkSense — As seen on Smashing Startups

© 2026 Informacijske storitve BACK2PIXELS, Jan Kokalj s.p. All rights reserved.

Getting Started

Introduction

Core Features

ProjectsDynamic LinksURL ShorteningSocial PreviewsLanding PagesAnalytics

Deep Linking

iOS Deep LinkingAndroid Deep LinkingTransactional EmailDeep Links in Email

Mobile SDKs

iOS SDKBetaAndroid SDKBetaFlutter SDKPreviewFlutterFlow SDKSoonReact Native SDKBeta

Account & Billing

Plans & Billing

Migration

Firebase Migration

API Reference

API OverviewAPI Endpoints
DocsMobile SDKsAndroid SDK
Mobile SDKs

Android SDK

Integrate the LinkSense Android SDK to enable deferred deep linking and dynamic link management in your Android app.
Beta
Beta release

The Android SDK is currently in beta. Public types under net.linksense.sdk.* may change between 0.x releases. Pin to an exact version in production (implementation("net.linksense:sdk:0.3.0")) and review the changelog before upgrading. We commit to API stability at 1.0.

Overview

The LinkSense Android SDK delivers four capabilities:

  • Install-time attribution — match a user's post-install session to the link they tapped before installing your app, including Play Install Referrer when available.
  • Deferred deep linking — surface the original link URL via a callback after install.
  • App Link forwarding — handle ACTION_VIEW intents, resolve them for your in-app routing, and report each app open to your LinkSense analytics.
  • Link CRUD — create, read, update, and delete dynamic links directly from the device.

The SDK has no Google Play Services dependency. The only Play-adjacent code is com.android.installreferrer (AIDL, not GMS). That library is always bundled; enableInstallReferrer = false only stops the SDK from reading it. It does not collect AAID, ANDROID_ID, IMEI, MAC, or the clipboard.

Prerequisites

  • minSdk 24 (Android 7.0)
  • JVM target 11, Kotlin 2.0+
  • Kotlin call sites. The SDK is a Kotlin object with suspend CRUD functions; from Java you would need LinkSense.INSTANCE, listeners returning Unit.INSTANCE, and a Kotlin wrapper for the CRUD calls
  • An SDK key from your LinkSense project (open your project's SDK Keys tab)
  • App Links configured for your project subdomain (see Android Deep Linking)

Installation

The SDK is published on Maven Central as net.linksense:sdk. Add it to your app module's build.gradle.kts:

dependencies {
implementation("net.linksense:sdk:0.3.0")
}

Make sure mavenCentral() is in your repositories block (it is by default in modern Gradle projects).

Configuration

Configure the SDK in your Application.onCreate() so it's ready before any Activity launches:

MyApp.kt
kotlin
import android.app.Application
import android.util.Log
import net.linksense.sdk.LinkSense
import net.linksense.sdk.LinkSenseConfiguration
import net.linksense.sdk.LinkSenseError
import net.linksense.sdk.LogLevel
 
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
try {
LinkSense.configure(
this,
LinkSenseConfiguration(
sdkKey = "ls_sdk_<project>_<random>",
enableInstallReferrer = true,
logLevel = LogLevel.OFF,
),
)
LinkSense.start()
} catch (e: LinkSenseError.InvalidSdkKey) {
Log.e("LinkSense", "Malformed SDK key", e)
}
}
}

Don't forget to register your Application subclass in AndroidManifest.xml:

AndroidManifest.xml
xml
<application
android:name=".MyApp"
...>
</application>

Configuration fields:

FieldTypeRequiredDescription
sdkKeyStringRequiredYour project SDK key (format: ls_sdk_<project>_<random>). Generate one in your project's SDK Keys tab.
enableInstallReferrerBooleanOptionalUse Google Play Install Referrer for high-confidence attribution. Requires the app to be installed via Play. Default true.
enableFingerprintBooleanOptionalSend the probabilistic fingerprint (IP, user agent, screen, locale) used when no Install Referrer click is available. Default true.
logLevelLogLevelOptionalDiagnostic logging level (OFF, ERROR, INFO, DEBUG). Default OFF — recommended for production.
Call configure exactly once

Subsequent calls to configure after the first are no-ops by design. The SDK reuses the same install idempotency key across cold starts to prevent double-attribution.

A malformed key throws LinkSenseError.InvalidSdkKey and leaves the SDK unconfigured, so start() does nothing and every CRUD call throws NotConfigured. You can call configure again with a corrected key. Copy the key from the dashboard rather than retyping it.

Handling Deferred Deep Links

Register a handler to receive the original dynamic link URL once attribution resolves. The callback fires on the main thread (Looper.getMainLooper()).

MyApp.kt
kotlin
LinkSense.onDeferredDeepLink { uri ->
uri?.let { router.handle(it) }
}
When does this fire?

On the first launch after install the listener receives the matched link, or null if no click matched. If /install finds no match right away, the SDK checks again after about 1.5 s and 5 s before giving up, so an organic install gets its null roughly 5 seconds after start(). On every later launch the listener fires with null straight away. Treat null as "nothing to route", not as "organic install": if you need a once-per-install branch, keep your own first-launch flag.

Play Install Referrer vs. fingerprint

If enableInstallReferrer is true and the app was installed via Google Play, the SDK uses the Install Referrer click id for high-confidence attribution (the referrer read is capped at 5 s). Otherwise it falls back to probabilistic fingerprint matching. A failed /install is retried with backoff and, if still failing, resent on a later launch for up to 24 hours.

Forwarding App Links

When your app is opened via an App Link tap, forward the intent to the SDK. handleIntent returns true when the intent carried a link it handled. On the first launch after install the tap is also used for attribution and the listener receives the matched deep link; after that it receives the tapped URL.

MainActivity.kt
kotlin
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (savedInstanceState == null) {
LinkSense.handleIntent(intent) { uri ->
uri?.let { router.handle(it) }
}
}
}
 
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
LinkSense.handleIntent(intent) { uri ->
uri?.let { router.handle(it) }
}
}
}

Each forwarded link is also reported to LinkSense as an app open, so opens from verified App Links show in your analytics. The report never delays your listener. Forward the launch intent only when savedInstanceState == null, as above: a re-created activity (rotation, process restore) carries the same intent again, and forwarding it would count one open twice.

For Digital Asset Links (assetlinks.json) hosting and the autoVerify intent filter, see Android Deep Linking.

Link CRUD

The SDK exposes createLink(options), getLink(id), updateLink(id, options), and deleteLink(id) as suspend functions. Call them from a coroutine scope. The option and model types (CreateLinkOptions, UpdateLinkOptions, FieldUpdate, Link, LinkMetadataValue) live in net.linksense.sdk.links:

Creating a link
kotlin
import net.linksense.sdk.LinkSense
import net.linksense.sdk.LinkSenseError
import net.linksense.sdk.links.CreateLinkOptions
 
lifecycleScope.launch {
try {
val link = LinkSense.createLink(
CreateLinkOptions(
name = "Summer sale",
desktopUrl = "https://example.com/sale",
androidFallbackUrl = "https://play.google.com/store/apps/details?id=com.example.myapp",
)
)
println("Created: ${link.fullUrl}")
} catch (e: LinkSenseError) {
println("Failed: $e")
}
}
Three-state PATCH semantics

UpdateLinkOptions uses FieldUpdate<T> with three variants: FieldUpdate.Unchanged (don't send the field, the default), FieldUpdate.Set(value) (send a new value), or FieldUpdate.Clear (explicitly null the field server-side). Clear only compiles for clearable fields; name, tags and iosClipboardEnabled can be set but not cleared. Links you read back expose their custom data as link.metadata.

Error Handling

All CRUD methods throw LinkSenseError — a sealed class mapping server error codes to typed subtypes:

Switching on LinkSenseError
kotlin
lifecycleScope.launch {
try {
val link = LinkSense.getLink(linkId)
// use link
} catch (e: LinkSenseError) {
when (e) {
is LinkSenseError.NotConfigured -> println("Call configure() first")
is LinkSenseError.Network -> println("Network failure: ${e.cause}")
is LinkSenseError.RateLimited -> println("Retry after ${e.retryAfterSeconds}s")
is LinkSenseError.InvalidInput -> println("Invalid fields: ${e.fieldErrors}")
is LinkSenseError.AccessDenied -> println("Plan limit: ${e.currentUsage}/${e.limit} on ${e.plan}")
is LinkSenseError.Server -> println("Server ${e.code} (HTTP ${e.status}): ${e.serverMessage}")
else -> println("Other error: $e")
}
}
}

Subtypes: NotConfigured, InvalidSdkKey, Network, Unauthorized, ForbiddenCrossScope, ForbiddenField, InvalidInput, NotFound, SlugExists, AccessDenied, RateLimited (retryAfterSeconds, may be null), DecodeFailure, Server (carries code, serverMessage and the HTTP status).

AccessDenied is thrown when your plan blocks the call — createLink with no subscription or at the link limit — or when the SDK key isn't allowed on Android. It carries serverMessage, upgradeRequired (false when the server sends no details) and the nullable plan, currentUsage and limit. Server codes without a dedicated subtype arrive as Server with the code string.

Example & Resources

The SDK is published on Maven Central as net.linksense:sdk. Expo and React Native apps use the React Native SDK, which bundles it.

Android Deep LinkingConfigure assetlinks.json and App Links.iOS SDKIntegration guide for iOS.Flutter SDKCross-platform integration with Flutter.API ReferenceHTTP endpoints behind the SDK.
PreviousiOS SDKNextFlutter SDK

On this page

  • Overview
  • Prerequisites
  • Installation
  • Configuration
  • Handling Deferred Deep Links
  • Forwarding App Links
  • Link CRUD
  • Error Handling
  • Example & Resources