Android in five steps
The shortest path to a working Android integration. Every step is the minimum that works, with no options. For anything beyond that, each step links to the Android SDK reference, which is where the detail lives.
1. Install
Section titled “1. Install”dependencies { implementation("com.tolinku:sdk:0.8.1")}2. Set up App Links
Section titled “2. Set up App Links”You need an intent filter with android:autoVerify="true" and an
assetlinks.json served from your domain carrying your signing certificate’s
SHA-256 fingerprint. Both are in
App Links (Android).
If Android shows a dialog asking which app to open, that is a verification failure, not a code problem: see Troubleshooting Android.
3. Configure
Section titled “3. Configure”import com.tolinku.sdk.Tolinku
class MyApp : Application() { override fun onCreate() { super.onCreate() Tolinku.configure( apiKey = "tolk_pub_your_key", context = this, ) }}Pass context. It is what enables lifecycle-aware flushing, so queued events
leave before the process does.
Get the key from the dashboard under API keys. The publishable key
(tolk_pub_) is the right one for an app.
4. Claim the deferred link on first launch
Section titled “4. Claim the deferred link on first launch”This is what recovers the link somebody tapped before they had your app.
val link = Tolinku.deferred.claimDeferredLink( appspaceId = "64f0a1b2c3d4e5f60718", context = applicationContext,)link?.deepLinkPath?.let { path -> // Route to path, then step 5.}Call it once, on the first launch after install. The claim is spent the first time it succeeds. The SDK reads the Play Install Referrer itself and falls back to device signals, so this one call is the whole integration.
appspaceId is the Appspace ID from Settings, not your subdomain. Passing
the subdomain makes every call return null. See
finding your Appspace ID.
5. Report the open
Section titled “5. Report the open”Two calls, and they are not the same event.
An ordinary open arrives in two places, and both need reporting:
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) intent?.data?.let { lifecycleScope.launch { Tolinku.trackLinkOpen(it.toString()) } }}
override fun onNewIntent(intent: Intent) { super.onNewIntent(intent) intent.data?.let { lifecycleScope.launch { Tolinku.trackLinkOpen(it.toString()) } }}Or call Tolinku.enableAutoLinkTracking() beside configure and the onCreate
half is handled for you. Keep the onNewIntent call either way.
The open that follows the claim in step 4, which is the last step of the install funnel:
link.url?.let { Tolinku.trackLinkOpen(it, deferred = true) }Report link.url, never the path. A path is dropped before it leaves the SDK,
silently. This needs SDK 0.8.1 or later.
Whether these are counted, and what they cost, is an Appspace setting: Attributing app opens.
That is a working integration. For referrals, in-app messages, ecommerce events, custom events and every option on the calls above, go to the Android SDK reference.