SDK Guide

Android Deep Linking SDK

Native Kotlin SDK for Android deep linking. App Links with automatic assetlinks.json hosting, deferred deep linking, and install attribution. Compatible with Jetpack Compose and View-based apps.

Quick Start

1

Add the dependency

In your app's build.gradle (Kotlin DSL):

dependencies {
    implementation("ly.ulink:sdk:latest")
}

Or with Groovy:

dependencies {
    implementation 'ly.ulink:sdk:latest'
}
2

Configure AndroidManifest.xml

Add intent-filter to your main Activity:

<activity
    android:name=".MainActivity"
    android:exported="true">

    <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="yourapp.ulink.ly" />
    </intent-filter>

</activity>
3

Initialize the SDK

import ly.ulink.sdk.ULink

class MyApplication : Application() {

    override fun onCreate() {
        super.onCreate()

        ULink.configure(
            context = this,
            apiKey = "your-api-key"
        )
    }
}
4

Handle incoming links

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // Handle link that opened the app
        handleIntent(intent)
    }

    override fun onNewIntent(intent: Intent?) {
        super.onNewIntent(intent)
        intent?.let { handleIntent(it) }
    }

    private fun handleIntent(intent: Intent) {
        ULink.handleIntent(intent) { link ->
            link?.let {
                // Route user based on link.path and link.parameters
                val productId = it.parameters["product"]
                val referralCode = it.parameters["ref"]

                // Navigate to appropriate screen
            }
        }
    }
}
5

Handle deferred deep links

// Call on first launch to get link from pre-install click
ULink.getInitialLink { link ->
    link?.let {
        // User came from a link before installing
        val referralCode = it.parameters["ref"]
        val productId = it.parameters["product"]

        // Navigate to appropriate content
        // Credit referral, etc.
    }
}

Android App Links

Android App Links are verified deep links that open your app directly without showing a disambiguation dialog. When properly configured, your app is the default handler for links to your domain.

ULink handles the hard parts:

  • Digital Asset Links (assetlinks.json) file hosting
  • Automatic SSL certificate management
  • SHA-256 fingerprint verification
  • Fallback handling when app isn't installed

Important: autoVerify

The android:autoVerify="true" attribute is required for App Links. Without it, Android won't verify your domain and users may see a chooser dialog. Make sure your package name and signing certificate SHA-256 are configured in your ULink project settings.

Jetpack Compose Integration

The ULink SDK works seamlessly with Jetpack Compose. Here's how to handle deep links in a Compose app:

@Composable
fun MyApp() {
    val navController = rememberNavController()

    // Handle deep links
    LaunchedEffect(Unit) {
        ULink.linkFlow.collect { link ->
            link?.let {
                // Navigate based on link
                when (it.path) {
                    "/product" -> {
                        val productId = it.parameters["id"]
                        navController.navigate("product/$productId")
                    }
                    "/profile" -> {
                        navController.navigate("profile")
                    }
                }
            }
        }
    }

    NavHost(navController = navController, startDestination = "home") {
        composable("home") { HomeScreen() }
        composable("product/{id}") { ProductScreen() }
        composable("profile") { ProfileScreen() }
    }
}

Deferred Deep Linking

Deferred deep linking preserves link context when a user doesn't have your app installed. ULink uses multiple attribution methods to ensure reliable matching.

Attribution methods used:

  • Google Install Referrer: Most accurate when available
  • Device fingerprinting: Fallback using device characteristics
  • Clipboard detection: Optional, for app-to-app flows

Use cases:

  • Referral programs: Credit the referrer even for new installs
  • Content sharing: Open specific content after install
  • Marketing campaigns: Track which ad drove the install
  • Personalized onboarding: Customize first-launch experience

Frequently Asked Questions

Ready to add deep linking to Android?

Create a free account and get your API key. Most teams integrate in under 30 minutes.