Docs

Link Creation

Generate smart links programmatically in your Android app

Using a callback

Kotlin
Grovs.generateLink(
    title = "Check out this product",
    subtitle = "Limited time offer",
    imageURL = "https://example.com/image.jpg",
    data = mapOf("productId" to "12345", "screen" to "product_detail"),
    tags = listOf("promotion", "share"),
    customRedirects = null,
    showPreviewIos = null,
    showPreviewAndroid = null,
    tracking = TrackingParams(
        utmMedium = "share_button",
        utmSource = "in_app",
        utmCampaign = "spring_sale"
    ),
    lifecycleOwner = this,
    listener = { link, error ->
        link?.let { Log.d("Grovs", "Generated: $it") }
        error?.let { Log.e("Grovs", "Error: $it") }
    }
)

Using coroutines

Kotlin
lifecycleScope.launch {
    try {
        val link = Grovs.generateLink(
            title = "Check out this product",
            subtitle = "Limited time offer",
            imageURL = "https://example.com/image.jpg",
            data = mapOf("productId" to "12345"),
            tags = listOf("promotion"),
            tracking = TrackingParams(
                utmCampaign = "spring_sale",
                utmSource = "in_app",
                utmMedium = "share_button"
            )
        )
        Log.d("Grovs", "Generated: $link")
    } catch (e: GrovsException) {
        Log.e("Grovs", "Error: ${e.message}")
    }
}

Parameters

ParameterTypeDescription
titleString?Link preview title
subtitleString?Link preview subtitle
imageURLString?Link preview image URL
dataMap<String, Serializable>?Custom payload delivered on deep link open
tagsList<String>?Tags for filtering and analytics
customRedirectsCustomRedirects?Override default redirect behavior
showPreviewIosBoolean?Show link preview on iOS (uses dashboard default if null)
showPreviewAndroidBoolean?Show link preview on Android (uses dashboard default if null)
trackingTrackingParams?UTM tracking parameters