Home Uncategorized

Android SDK

Last updated on Apr 27, 2026

Android SDK reference

Pair this with the Android setup tutorial. Below are the primary methods exposed by LinkMe.shared.

Installation

Gradle dependency: implementation("me.li-nk:linkmekit:0.2.9")

Artifacts are available via Maven Central (central.sonatype.com/artifact/me.li-nk/linkmekit).

Payload shape

LinkMePayload mirrors the iOS structure:

Field Type Description
linkId String? Unique link identifier.
path String? Deep-link path defined on the link.
params Map<String, String>? Query parameters merged from the click.
utm Map<String, String>? UTM data.
custom Map<String, String>? Custom metadata saved with the link.
url String? Original universal link URL, when available.
isLinkMe Boolean? true for LinkMe-resolved links, false for basic universal link fallbacks.

Core API

LinkMe.shared.configure(context, config)

Initializes the SDK. Call once, typically in Application.onCreate.

Config field Type Description
appId String? App identifier from the portal.
appKey String? Optional read-only key.
sendDeviceInfo Boolean Default true.
includeVendorId Boolean Default true. Sends Android ID.
includeAdvertisingId Boolean Default false. Enable after consent.
debug Boolean Default false.

Enable verbose logging by setting debug = true (typically BuildConfig.DEBUG). When enabled, LinkMe prints install referrer, fingerprint, and network events to Logcat to help debug fingerprint mismatches.

LinkMe.shared.handleIntent(intent) / onNewIntent(intent)

Feed intents from Activity.onCreate and Activity.onNewIntent so LinkMe can parse them.

override fun onCreate(savedInstanceState: Bundle?) {
  super.onCreate(savedInstanceState)
  LinkMe.shared.handleIntent(intent)
}

override fun onNewIntent(intent: Intent?) {
  super.onNewIntent(intent)
  LinkMe.shared.onNewIntent(intent)
}

LinkMe.shared.getInitialLink(callback)

Asynchronously delivers the payload that opened the app via App Links or a custom scheme.

LinkMe.shared.getInitialLink { payload ->
  payload?.let(::routeUser)
}

LinkMe.shared.setUserId(id)

Associates a user identifier with future events.

LinkMe.shared.addListener(callback)

Subscribes to future payloads while the app stays alive. Returns an unsubscribe function.

val unsubscribe = LinkMe.shared.addListener { payload ->
  routeUser(payload)
}

// Later
unsubscribe()

LinkMe.shared.claimDeferredIfAvailable(context, callback)

Uses the Play Install Referrer (with fingerprint fallback) to tie first installs to prior clicks.

LinkMe.shared.claimDeferredIfAvailable(applicationContext) { payload ->
  payload?.let(::routeUser)
}

LinkMe.shared.track(event, properties)

Sends analytics events.

LinkMe.shared.track("open")
LinkMe.shared.track("purchase", mapOf("amount" to 9.99))

LinkMe.shared.setAdvertisingConsent(granted)

Toggles whether the Advertising ID may be sent. Call after your own consent dialog:

LinkMe.shared.setAdvertisingConsent(true)

Intent helpers

  • Ensure your manifest includes an HTTPS App Link with android:autoVerify="true" and (optionally) a custom scheme.
  • LinkMe automatically writes the correct assetlinks.json once you configure your package name + SHA-256 in the portal.