Skip to main content
The Tolt Android library claims a partner’s code for an app user. Tolt then credits that partner with the purchases RevenueCat reports for the same user. See Mobile apps for how it fits together.
Tolt.claimPOST /client/claims Tolt
Sent by the SDK
claimrequest
app_user_id
code
first_seen_at
In Tolt
customercus_7Lm2…
customer_id
partner
statuslead

Install

Add the library from Maven Central to your app module:
build.gradle.kts
It supports Android 5.0 (API 21) and later. It depends only on Kotlin coroutines and the Play Install Referrer library.

Configure

Call configure once in your Application with your public key from Settings → Integrations in the dashboard. The SDK remembers the first launch, which the program’s claim window counts from.
App.kt

Claim a code

Claim the code when the user enters one. Pass the app user id you give RevenueCat. The claim functions suspend, so call them from a coroutine such as lifecycleScope.launch.
Kotlin
Also store the code on the RevenueCat customer. If a purchase reaches Tolt before the claim, Tolt uses it to credit the partner.
Kotlin
When a partner app link opens your app with tolt_click or tolt_code in the URL, pass the Uri on. It returns null for links without either.
MainActivity.kt
Do the same with intent.data in onCreate for links that start the app. With a deep linking provider, read the click from its callback instead and call Tolt.claimClick(clickId, appUserId).

Claim a Google Play install

When the program has no deep link template and a Google Play URL is set, app links send Android users to Google Play with the code and click in the install referrer. Claim it when the app starts:
Kotlin
It returns null when the install didn’t come from a partner link. Each install’s referrer is claimed once. If Google Play can’t be reached, or the claim fails for a temporary reason, the next call tries again.

Results and errors

claim returns a ClaimResult with a status: It throws a ToltException, or an IOException when the request can’t reach Tolt: