android-sdk.md
Grovs is a powerful SDK that enables deep linking, universal linking, attribution, and in-app messaging for Android applications. This guide provides a complete reference for configuration, API methods, and practical usage examples.
Add the following dependency to your build.gradle:
implementation("io.grovs:Grovs:1.0.12")override fun onCreate() {
super.onCreate()
Grovs.configure(this, "your-api-key", useTestEnvironment = false)
Grovs.setDebug(Grovs.DebugLevel.INFO) // Optional
}override fun onStart() {
super.onStart()
Grovs.onStart()
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
Grovs.onNewIntent(intent)
}<intent-filter>
<data android:scheme="your_app_scheme" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<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="your_app_host" />
</intent-filter>
<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="your_app_test_host" />
</intent-filter>fun configure(application: Application, apiKey: String, useTestEnvironment: Boolean)fun setSDK(enabled: Boolean)
fun setDebug(level: LogLevel) // INFO or ERRORGrovs.generateLink(
title = "Title",
subtitle = "Subtitle",
imageURL = "https://example.com/image.png",
data = mapOf("key" to "value"),
tags = listOf("promo"),
customRedirects = null,
showPreviewIos = true,
showPreviewAndroid = false,
lifecycleOwner = this,
listener = { link, error ->
link?.let { Log.d("Grovs", "Link: $it") }
error?.let { Log.e("Grovs", "Error: $it") }
}
)val link = Grovs.generateLink(
title = "Title",
subtitle = "Subtitle",
imageURL = "https://example.com/image.png",
data = mapOf("key" to "value"),
tags = listOf("promo")
)fun setOnDeeplinkReceivedListener(activity: Activity, listener: GrovsDeeplinkListener)or use Kotlin Flow:
Grovs.Companion::openedLinkDetails.flow.collect { deeplinkDetails ->
Log.d("Grovs", "Link: ${deeplinkDetails?.link}, Payload: ${deeplinkDetails?.data}")
}fun onStart()
fun onNewIntent(intent: Intent?)Grovs.displayMessagesFragment {
// Called when dismissed
}val count = Grovs.numberOfUnreadMessages()fun linkDetails(path: String, lifecycleOwner: LifecycleOwner?, listener: GrovsLinkDetailsListener)val details = Grovs.linkDetails(path = "123456")Grovs.identifier = "user123"
Grovs.attributes = mapOf("name" to "Alice", "tier" to "Premium")
Grovs.pushToken = "FCM_TOKEN"| Property | Type | Description |
|---|---|---|
useTestEnvironment |
Boolean | Enables test environment. |
identifier |
String? | Set user ID to help track in dashboard. |
attributes |
Map<String, Any>? | Attach user attributes for analytics and personalization. |
openedLinkDetails |
DeeplinkDetails? (Flow) | Kotlin Flow to receive deeplink info. |
pushToken |
String? | Push notification token. |
val token = FirebaseMessaging.getInstance().token
Grovs.pushToken = token
val unreadCount = Grovs.numberOfUnreadMessages()
Grovs.displayMessagesFragment {}- Refer to official documentation for full SDK reference.
- Contact support@grovs.io for technical support.
Thank you for using Grovs SDK! 🚀