# Add live chat to an Android app: Frosvo SDK guide

Source: https://frosvo.com/docs/add-chat-to-android-app
Updated: 2026-10-25

Add the Frosvo chat SDK to an Android app in Kotlin or Java. Configure it with your website key, open the chat from a Help button, and send push replies through Firebase.

Customers who get stuck inside your app should not have to leave it to find help. The Frosvo SDK for Android puts a full-screen chat behind a Help button, shows an unread badge, and sends replies to the phone as push notifications. Conversations arrive in the same shared inbox as your website chats.

## What do I need before I start?

- An Android app (Android 6.0 or later, API 23), written in Kotlin or Java.
- A Frosvo account with the website that stands for your app added under **Settings → Websites**, and its **website key** copied.
- For push notifications: a Firebase project for your app.

## How do I add the SDK?

1. Download the Android SDK from **Settings → Mobile apps**, or from [`/downloads/frosvo-android.zip`](/downloads/frosvo-android.zip), and unzip it.
2. Copy the folder into your project as a module, for example `frosvo-chat/`.
3. Include it in your Gradle files:

   ```kotlin
   // settings.gradle.kts
   include(":frosvo-chat")

   // app/build.gradle.kts
   dependencies { implementation(project(":frosvo-chat")) }
   ```

   If your project already declares the Android and Kotlin plugins, remove the plugin versions from the module's own `build.gradle.kts`.

## How do I show the chat?

```kotlin
import com.frosvo.chat.Frosvo

// Once, in Application.onCreate
Frosvo.configure("your-website-key")

// When someone signs in to your app (optional)
Frosvo.setUser(name = "Pat Lee", email = "pat@example.com", hash = hashFromYourServer)

// From a "Help" button
Frosvo.open(context)

// Unread badge
Frosvo.onUnread = { count -> helpBadge.number = count }

// When someone signs out
Frosvo.reset()
```

The hash is optional. It proves to Frosvo that the user really is who you say. See [show signed-in customers by name](/docs/identify-signed-in-customers) for how your server makes it.

## How do I add push notifications?

1. In Frosvo, open **Settings → Mobile apps**, choose the website and paste your Firebase service-account JSON (Firebase console, Project settings, Service accounts, Generate new private key).
2. Pass the token to the SDK and let it show Frosvo's messages:

   ```kotlin
   class MessagingService : FirebaseMessagingService() {
       override fun onNewToken(token: String) = Frosvo.setFcmToken(token)

       override fun onMessageReceived(message: RemoteMessage) {
           if (Frosvo.showNotification(this, message.data, message.notification?.title, message.notification?.body)) return
           // your own messages
       }
   }
   ```

3. Also call `Frosvo.setFcmToken(FirebaseMessaging.getInstance().token.await())` at start-up, and on Android 13 and later ask for the `POST_NOTIFICATIONS` permission.

Replies are pushed only when the person has not already read them on screen. Each message carries `frosvo: "1"`, `conversation_id` and `site_key`, and tapping the notification opens that conversation.

## How do I test it?

1. Run the app, tap your Help button and send a message.
2. Open the Frosvo desk: the message is in the shared inbox, labelled with your website.
3. Reply from the desk. With the app closed, a push notification should reach the phone; tap it and the conversation opens.
4. Sign in and out of your app and check the desk shows the right name, and that after `Frosvo.reset()` a new person starts a fresh conversation.

## What if it does not work?

- **The chat opens blank.** Check the website key, and that the phone has an internet connection.
- **No push notification arrives.** Check the Firebase service account is saved for this website, the token reached `setFcmToken`, and the notification permission is granted on Android 13 and later.
- **The wrong person's history shows.** Call `Frosvo.reset()` when someone signs out.

For the overview of all four SDKs and push, see [chat in your mobile apps](/docs/mobile-apps). If you build your own screens, the [developer hub](/developers) has the REST API and real-time events. For other problems, try [troubleshooting](/docs/troubleshooting). Building for several platforms? The same chat is available for [iOS](/docs/add-chat-to-ios-app), [React Native](/docs/add-chat-to-react-native-app) and [Flutter](/docs/add-chat-to-flutter-app).

## Common questions

### Which Android versions does the SDK support?

Android 6.0 and later (API 23), in Kotlin or Java.

### Do I have to build the chat screen myself?

No. The SDK opens a full-screen chat for you, the same chat your website visitors use, so you only add a Help button and call one function.

### How do push notifications work on Android?

Paste your Firebase service account into Settings, Mobile apps, then pass the Firebase token to the SDK. Replies are pushed only when the person has not already read them on screen.

### Do I need a server to use it?

No, unless you want to prove who the user is. The optional hash that verifies a signed-in user is made on your own server with a secret from Frosvo.
