Skip to content
Documentation menu

Set up your app

Android (Kotlin)

Set up DL2App App Links and deferred deep linking in a Kotlin app: intent filters, signing fingerprints, configure and handleIntent.

1. Intent filter

Inside your main activity in AndroidManifest.xml:

<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="myapp.dl2.app" />
  <data android:scheme="https" android:host="myapp-alt.dl2.app" />
  <data android:scheme="https" android:host="go.myapp.com" />
</intent-filter>

2. Signing fingerprints

Android verifies the hosts against the SHA-256 fingerprint of the certificate that signed the installed app. Enter every one that applies under Apps in the dashboard:

  • With Play App Signing, the app signing key fingerprint from Play Console, under Protected with Play → Play Store distribution → Go to Play app signing, in the “App signing key” section. This is the one most people miss.
  • Your upload or debug key, if you test builds that are not from the Play Store.

3. Configure and listen

MainActivity.kt
import app.dl2.sdk.DL2

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        DL2.configure(applicationContext, "pk_live_xxx") {
            linkDomains = listOf("myapp.dl2.app", "myapp-alt.dl2.app", "go.myapp.com")
        }
        DL2.onLink { link -> navigate(link.path, link.data) }
        DL2.handleIntent(intent)
    }

    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        DL2.handleIntent(intent)
    }
}

On first launch the SDK reads the Play Install Referrer, which carries the tap through the install exactly. Nothing else is needed for deferred links on Android.

Check verification

adb shell pm verify-app-links --re-verify com.example.myapp
adb shell pm get-app-links com.example.myapp

Each host should say verified. If one says legacy_failure or 1024, the fingerprint in the dashboard does not match the installed build.

What the SDK does for you

  • Delivers one event for all three cases: a link that cold-starts the app, a link while it is running, and a deferred link on first launch.
  • Queues links that arrive before your listener is registered, so a cold-start link is never lost.
  • Falls back to the URL’s own path and query if our API cannot be reached within 3 seconds, so the app still navigates.
  • Never throws into your app: errors go to an onError callback.
  • Reads no advertising identifier. See Privacy and App Store disclosure.
Android (Kotlin) · Docs · DL2App