SDK

Android SDK (Kotlin)

Upgrade to 0.3.3 or later for distinct redeem error statuses and a single automatic network retry on applyCode().

Native Kotlin library for creator install attribution. From 0.3.0, the SDK reads the Play Install Referrer itself on first install for a deterministic match. Pass installReferrer to trackInstall() only to override it when testing.

Prerequisites

1. Add the dependency

dependencyResolutionManagement {
  repositories {
    google()
    mavenCentral()
    maven { url = uri("https://jitpack.io") }
  }
}

implementation("com.github.tapapplink:tapapplink-android:0.3.3")

The artifact is built from https://github.com/tapapplink/tapapplink-android on JitPack (same pattern as many mobile attribution SDKs). Sync Gradle after adding the repository and dependency.

2. Configure, track, identify

Initialize as early as possible. A custom Application class is ideal. From 0.3.0, the SDK reads the Play Install Referrer itself. Pass installReferrer to trackInstall(context, installReferrer) only to override it when testing.

TapAppLink.configure(
  TapAppLinkConfig(
    publicKey = "YOUR_TAPAPPLINK_KEY",
    environment = TapAppLinkEnvironment.PRODUCTION,
  )
)

TapAppLink.trackInstall(context) { }
TapAppLink.setAppUserId(Purchases.sharedInstance.appUserID) { }
val offer = TapAppLink.getOffer()

3. Discount codes

TapAppLink.getOffer() after a match, TapAppLink.applyCode("SARAH10") when the user types a code. Discount codes.

SDK reference

MethodPurpose
configureSet public key, environment, optional ingest URL.
trackInstall()First open. Matches a recent click in this environment.
setAppUserId(id)Bridge the billing customer id for webhooks.
getOffer()Creator discount after a match or redeem.
applyCode(code)Attribute from a promo code typed at checkout.
resetForTesting()Clear cached install state in debug builds.

Important notes