Docs

API Reference

Complete Android SDK properties and methods reference

Properties

useTestEnvironment

Kotlin
Grovs.useTestEnvironment: Boolean

Set to true to enable the test environment.

identifier

Kotlin
Grovs.identifier: String?

Get or set the user identifier. This value appears in the Grovs dashboard and reports. Typically set to your app's user_id.

attributes

Kotlin
Grovs.attributes: Map<String, Any>?

Get or set user attributes. These appear in the Grovs dashboard for user identification and behavior analysis.

openedLinkDetails

Kotlin
Grovs.openedLinkDetails: DeeplinkDetails?

Kotlin Flow that emits deep link details when the app is opened from a Grovs link.

pushToken

Kotlin
Grovs.pushToken: String?

Get or set the push notification token for receiving dashboard messages.


Methods

configure

Kotlin
fun configure(application: Application, apiKey: String, useTestEnvironment: Boolean = false)

Initialize the SDK with your API key. Call this in your Application.onCreate().

setSDK

Kotlin
fun setSDK(enabled: Boolean)

Enable or disable the SDK.

setDebug

Kotlin
fun setDebug(level: LogLevel)

Set the debug logging level. Options: INFO, ERROR.

onStart

Kotlin
fun onStart(activity: Activity)

Forward the launcher activity's onStart() to the SDK. Required.

onNewIntent

Kotlin
fun onNewIntent(intent: Intent?)

Forward the launcher activity's onNewIntent() to the SDK. Required.

Kotlin
fun generateLink(
    title: String? = null,
    subtitle: String? = null,
    imageURL: String? = null,
    data: Map<String, Serializable>? = null,
    tags: List<String>? = null,
    customRedirects: CustomRedirects? = null,
    showPreviewIos: Boolean? = null,
    showPreviewAndroid: Boolean? = null,
    tracking: TrackingParams? = null,
    lifecycleOwner: LifecycleOwner? = null,
    listener: GrovsLinkGenerationListener
)

Generate a smart link and receive the result via callback.

Kotlin
suspend fun generateLink(
    title: String? = null,
    subtitle: String? = null,
    imageURL: String? = null,
    data: Map<String, Serializable>? = null,
    tags: List<String>? = null,
    customRedirects: CustomRedirects? = null,
    showPreviewIos: Boolean? = null,
    showPreviewAndroid: Boolean? = null,
    tracking: TrackingParams? = null
): String

Generate a smart link using Kotlin coroutines.

setOnDeeplinkReceivedListener

Kotlin
fun setOnDeeplinkReceivedListener(launcherActivity: Activity, listener: GrovsDeeplinkListener)

Register a listener for deep link events.

displayMessagesFragment

Kotlin
fun displayMessagesFragment(onDismissed: (() -> Unit)?)

Display the messages list as a modal fragment.

numberOfUnreadMessages

Kotlin
suspend fun numberOfUnreadMessages(): Int?

Get the count of unread messages.

linkDetails (callback)

Kotlin
fun linkDetails(path: String, lifecycleOwner: LifecycleOwner? = null, listener: GrovsLinkDetailsListener)

Get link details via callback.

linkDetails (coroutine)

Kotlin
suspend fun linkDetails(path: String): Map<String, Any>

Get link details using Kotlin coroutines.