Android SDK (Kotlin)
JitPack artifact with App Links verification.
Installation
dependencies {implementation("com.github.flinku-dev:android-sdk:0.7.1")}
Include the JitPack repository: https://jitpack.io
Configure
class MyApplication : Application() {override fun onCreate() {super.onCreate()Flinku.configure(this, baseUrl = "https://yourapp.flku.dev")}}
match()
match() recovers deferred install attribution. It is not your App Link / URI scheme handler. If your app already routes a launch URL, do not let a deferred match() result overwrite it — call match() only when no launch URL is present. See Apps that already handle their own deep links.
lifecycleScope.launch {val link = Flinku.match(context)if (link.matched) {startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(link.deepLink)))}}
reset()
Flinku.reset(context)
Clears the cached match result only. Does not clear the stored user id or pending referral attribution. This changed in 0.6.0.
resetAll()
Flinku.resetAll(context)
Clears everything reset() clears, plus the stored user id, referral project id, all pending referral records, and any tracked-once markers. Testing only — do not call in production. Calling it in production destroys real referral attribution. Added in 0.7.0.
createLink()
val link = flinku.createLink(FlinkuLinkOptions(title = "Summer Campaign",deepLink = "yourapp://promo",params = mapOf("ref" to "instagram")))println(link.shortUrl)
createLinkInstant()
Returns the short URL instantly without waiting for the server. The link is saved in the background. Use this for share buttons where speed matters.
If the background save fails on a transient error (network, timeout, 5xx, or 429), the SDK retries up to three times with 1s, 2s, and 4s delays. A URL shared immediately can still 404 for up to roughly 7 seconds while retries run. Enable debug logging in Flinku.configure(..., debug = true) to surface terminal failures in the console.
⚠️ Do not wrap createLinkInstant in an async function. It is synchronous and returns immediately. Wrapping it in async/await will add unnecessary delay and defeat the purpose.
val link = Flinku.createLinkInstant(FlinkuLinkOptions(title = "Summer Campaign",deepLink = "yourapp://promo",params = mapOf("ref" to "instagram")))val sendIntent = Intent(Intent.ACTION_SEND).apply {type = "text/plain"putExtra(Intent.EXTRA_TEXT, link.shortUrl)}startActivity(Intent.createChooser(sendIntent, null))