API Reference
Complete Android SDK properties and methods reference
Properties
useTestEnvironment
Grovs.useTestEnvironment: BooleanSet to true to enable the test environment.
identifier
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
Grovs.attributes: Map<String, Any>?Get or set user attributes. These appear in the Grovs dashboard for user identification and behavior analysis.
openedLinkDetails
Grovs.openedLinkDetails: DeeplinkDetails?Kotlin Flow that emits deep link details when the app is opened from a Grovs link.
pushToken
Grovs.pushToken: String?Get or set the push notification token for receiving dashboard messages.
Methods
configure
fun configure(application: Application, apiKey: String, useTestEnvironment: Boolean = false)Initialize the SDK with your API key. Call this in your Application.onCreate().
setSDK
fun setSDK(enabled: Boolean)Enable or disable the SDK.
setDebug
fun setDebug(level: LogLevel)Set the debug logging level. Options: INFO, ERROR.
onStart
fun onStart(activity: Activity)Forward the launcher activity's onStart() to the SDK. Required.
onNewIntent
fun onNewIntent(intent: Intent?)Forward the launcher activity's onNewIntent() to the SDK. Required.
generateLink (callback)
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.
generateLink (coroutine)
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
): StringGenerate a smart link using Kotlin coroutines.
setOnDeeplinkReceivedListener
fun setOnDeeplinkReceivedListener(launcherActivity: Activity, listener: GrovsDeeplinkListener)Register a listener for deep link events.
displayMessagesFragment
fun displayMessagesFragment(onDismissed: (() -> Unit)?)Display the messages list as a modal fragment.
numberOfUnreadMessages
suspend fun numberOfUnreadMessages(): Int?Get the count of unread messages.
linkDetails (callback)
fun linkDetails(path: String, lifecycleOwner: LifecycleOwner? = null, listener: GrovsLinkDetailsListener)Get link details via callback.
linkDetails (coroutine)
suspend fun linkDetails(path: String): Map<String, Any>Get link details using Kotlin coroutines.