Sections
Theme

Android setup

Install com.invitebase:sdk, wire App Links, and understand Play Install Referrer attribution

com.invitebase:sdk is the native Kotlin SDK, distributed via Maven Central. It implements the shared surface with the two Android attribution paths: App Links for friends who already have your app, and the Play Install Referrer API for deferred attribution — deterministic, first-party, no prompt, near-100% match rate for Play Store installs.

This page covers what's specific to Android — installation, App Links, and the Install Referrer. The methods themselves are documented once for all platforms in the SDK reference. For a guided first integration, see the Android quickstart.

All five SDKs ship as version 1.0 on November 15, 2026. Prebuilt UI components and push notifications are coming soon and are outside the November 15 release. Build custom UI with the SDK methods and reactive reads.

Install

app/build.gradle.kts
dependencies {
    implementation("com.invitebase:sdk:1.0.0")
}

The SDK bundles the com.android.installreferrer client, supports API 24+ (Android 7.0), and follows semver.

Configure at launch

Call configure once in Application.onCreate(). It generates (or restores) the anonymous ID from EncryptedSharedPreferences and — on first launch only — queries the Play Install Referrer for a referral code.

MycompanyApplication.kt
import android.app.Application
import com.invitebase.sdk.Invitebase

class MycompanyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Invitebase.configure(this, "pk_test_51Hq2jK")
    }
}

Register the Application class in your manifest:

AndroidManifest.xml
<application android:name=".MycompanyApplication" …>

App Links are the already-installed path: a friend taps https://mycompany.refr.link/a1b2c3, Android opens your app directly, and you hand the intent URI to handleInbound.

Invitebase serves /.well-known/assetlinks.json for your {app}.refr.link subdomain — you never host anything. Your steps:

  1. In the dashboard under Settings → Attribution, enter your package name and SHA-256 signing-certificate fingerprints.
  2. Add a verified intent filter to the activity that should receive links:
AndroidManifest.xml
<activity android:name=".MainActivity">
    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" android:host="mycompany.refr.link" />
    </intent-filter>
</activity>
  1. Hand incoming URIs to the SDK in both entry points:
MainActivity.kt
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Invitebase.handleInbound(intent?.data)
        // …
    }

    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        Invitebase.handleInbound(intent.data)
    }
}

Install Referrer notes

The Play Install Referrer is Android's deferred-attribution path, reported by resolveReferral: when an invitee without your app taps a referral link, the redirect sends them to the Play Store with referrer={code} on the URL; Google Play passes that string through the install, and on first launch the SDK recovers it via InstallReferrerClient — no prompt, no clipboard, deterministic.

  • One-shot: the SDK queries InstallReferrerClient once, on first launch, and never again after attribution resolves.
  • Play-Store-installs only: sideloads and other stores carry no referrer string — those installs resolve to needsManualEntry with a soft signal, and the manual code-entry fallback covers them.
  • Click and install-begin timestamps are captured alongside the code; they feed click-injection fraud detection.
  • No permissions and no user prompt are involved at any point.

Code entry UI

The prebuilt InvitebaseCodeEntry composable is coming soon. Build custom manual-entry UI over applyCode for launch.

Keep reward flows framed as a product benefit, not as payment for an install, review, or rating. Invitebase blocks cash-like rewards for the new Android user; use an offer code, free access, or an in-app reward instead. Grant anything valuable from your server via the signed reward webhook, and complete the Google Play referral compliance checklist before release.

Push notifications

Coming soon. Push notifications and setPushToken are outside the November 15 release. Use email notifications for launch.

What's next

On this page