Messages
In-app messaging and push notifications with the Grovs Android SDK
If console messages have automatic display enabled in your dashboard, they will appear in your app without any additional integration.
Push notifications
To receive push notifications for messages sent from the Grovs dashboard, pass the FCM token to the SDK:
Kotlin
val token = FirebaseMessaging.getInstance().token.await()
Grovs.pushToken = tokenDisplaying messages
Show the full list of messages as a modal fragment:
Kotlin
Grovs.displayMessagesFragment {
// Fragment was dismissed
}Unread count
Get the number of unread messages — useful for showing a badge:
Kotlin
val count = Grovs.numberOfUnreadMessages()
Log.d("Grovs", "Unread: $count")