Skip to main content
Routing (opening an already-installed app from https://yourbrand.dshl.in/Ab12Cd) is an OS App Link and does not require this SDK. Recovering the original content after a Play Store install, and joining that first open to the store tap, does.
pending.appUrl, pending.utmSource / utmMedium / utmCampaign, pending.isDeferred, and pending.clickId come from the JSON resolve body. The SDK resolves App Links and recovers the original destination on first open after a Play Store install, joining that open to the same click_id as the store tap.

When you need the SDK

Without the SDK, a fresh install opens on the home screen and the store tap cannot be joined to first open. See Receive for the routing vs deferred map.

Install

Maven coordinates will be published as ai.dashlink:dashlink-android:1.0.0. Until then, include the library module or build an AAR from the dashlink-android repo.
Min SDK 21. The library depends on Play Install Referrer. JSON resolve that writes tracking requires a Dynamic Link API key. REST keys (dlk_live_) are rejected.
  1. In the dashboard, go to Settings → API Keys → Type Dynamic Link.
  2. Copy the dlk_sdk_… key once and call Dashlink.configure before getInstance / getDynamicLink.
  3. The SDK sends it as X-API-Key (header only). A leaked APK key can hit that org’s resolve URL; it cannot call the dashboard REST API.
See API keys.
Dashlink already hosts assetlinks.json on the Dynamic Link domain. The app must still declare that host. App Links are host-wide: put an autoVerify intent-filter on {subdomain}.dshl.in, not only the marketing site.
Without this, Chrome never hands the tap to the app — Play opens even if the app is installed. The SDK cannot invent OS intercept. Reinstall after adding the filter so verification runs again. Fingerprints, Auto vs Manual mode, and Play App Signing live on App association.
Expect the Dynamic Link host listed as verified.

Receive live taps

Call getDynamicLink from the Activity that handles the VIEW intent, and from onNewIntent if launchMode is singleTop / singleTask.
setDynamicLinkHosts restricts which https URLs the SDK treats as Dashlink short URLs. If you skip it, any https intent with a back-half is resolved. On an installed tap the SDK JSON-resolves the short URL (deferred=0, match=direct), returns app_url, and analytics records app_open. The query parameters the SDK sends are listed on Receive.

Deferred first-open

When the app is missing, Dashlink 302s to the Play listing with:
On first open after install the SDK:
  1. Calls Play Install Referrer once.
  2. Decodes that URL.
  3. JSON-resolves with deferred=1, match=referrer, and the recovered click_id.
  4. Returns PendingDynamicLink (appUrl, UTMs, isDeferred=true, clickId).
  5. Marks deferred consumed in SharedPreferences (ai.dashlink.sdk / deferred_consumed) so a later launch does not re-fire.
If intent.data is already a Dashlink URL (installed tap), that wins and referrer is skipped. A 401 on JSON resolve means the key is missing, not a Dynamic Link key, revoked, or bound to another organization — no deferred_open is published.

Misses

An empty referrer, a foreign URL, or a referrer that is not this app’s Dynamic Link host is a miss. The SDK still marks deferred consumed. There is no silent home-screen drop that looks like success in analytics: the first-open path either yields deferred_open (when a joinable URL was recovered) or nothing to navigate. A miss is expected when the user installed from Play search rather than the Dynamic Link, or when Play stripped the referrer. Clearing app data re-runs recovery. Reinstall without data clear may still see Play’s cached referrer — Play documents that the referrer API is valid for a limited window after install. Recovery uses the Play Install Referrer value only. If the user never opened Play through a Dynamic Link that carried referrer=, or Play did not return that referrer, there is no destination to recover.

Tracking

The store 302 is the click. SDK JSON resolve is an outcome on that click when click_id matches, not a second campaign click. Campaign totals should unique-count by click_id. Do not add deferred_open to click volume. Replay of the same click_id still returns app_url but does not publish a second deferred_open.

Test on a device

Simulators do not exercise App Link verification the way a real device does.
1

Uninstall the app

So the next tap takes the store path.
2

Tap a staging Dynamic Link

The device 302s to Play. The referrer carries the short URL and dl_cid.
3

Install the debug APK

Sideload the build that includes the SDK and the autoVerify filter.
4

Open once

First open must land on app_url. Analytics must show deferred_open for the same click_id as the store tap.
If an installed tap still opens Chrome, the problem is almost always app association, not the SDK.

Sample and changelog

The sample app is a debug receiver for the live-tap and deferred path. Release notes live in the changelog.