Customerly is a customer service platform that helps businesses provide better support to their customers. The Android SDK allows you to integrate Customerly's features directly into your Android application, including:
- Live chat support
- Help center articles
- User profiling
- Event tracking
- Lead generation
- Surveys
- Real-time video calls
- Add the following dependency to your app's
build.gradlefile:
dependencies {
implementation 'io.customerly:customerlyandroidsdk:1.2.0'
}The SDK declares the permissions it needs (INTERNET, POST_NOTIFICATIONS, and the storage permissions used by the live-chat file-attachment flow) in its own manifest, so they are merged into your app automatically — no manifest changes are required.
Note: the SDK declares
MANAGE_EXTERNAL_STORAGE, which is subject to Google Play's All files access policy. If your app is distributed on Google Play you may need to justify this permission during review.
- Initialize the SDK in your Application class or MainActivity:
Customerly.load(context, CustomerlySettings(app_id = "YOUR_APP_ID"))- Show the chat interface:
Customerly.show()Initializes the Customerly SDK with the provided settings.
Customerly.load(context, CustomerlySettings(app_id = "YOUR_APP_ID"))Updates the context used by the SDK. Call this when your application's context changes.
Customerly.setContext(context)Updates the Customerly SDK settings.
Customerly.update(CustomerlySettings(app_id = "YOUR_APP_ID"))Requests notification permissions if not already granted.
Customerly.requestNotificationPermissionIfNeeded()Shows the Customerly chat interface.
Customerly.show()Hides the Customerly chat interface.
Customerly.hide()Navigates back in the chat interface.
Customerly.back()Logs out the current user.
Customerly.logout()Registers a new lead with the provided email and optional attributes.
Customerly.registerLead(email = "test@customerly.io", attributes = mapOf("name" to "John Doe"))Shows the chat interface with a pre-filled message.
Customerly.showNewMessage(message = "Hello, how are you?")Sends a new message and shows the chat interface.
Customerly.sendNewMessage(message = "Hello, how are you?")Navigates to a specific conversation.
Customerly.navigateToConversation(conversationId = 123)Shows a specific help center article.
Customerly.showArticle(collectionSlug = "collection", articleSlug = "article")Tracks a custom event.
Customerly.event(name = "event_name")Sets a custom attribute for the current user.
Customerly.attribute(name = "attribute_name", value = "attribute_value")Gets the count of unread messages.
Customerly.getUnreadMessagesCount(resultCallback = { count ->
Log.d("Customerly", "Unread messages count: $count")
})Gets the count of unread conversations.
Customerly.getUnreadConversationsCount(resultCallback = { count ->
Log.d("Customerly", "Unread conversations count: $count")
})The SDK provides various callback methods to handle different events:
fun setOnChatClosed(callback: () -> Unit)
fun setOnChatOpened(callback: () -> Unit)
fun setOnMessageRead(callback: (Int, Int) -> Unit)
fun setOnMessengerInitialized(callback: () -> Unit)
fun setOnNewMessageReceived(callback: (UnreadMessage) -> Unit)
fun setOnNewConversation(callback: (String, List<AttachmentPayload>) -> Unit)
fun setOnNewConversationReceived(callback: (Int) -> Unit)
fun setOnHelpCenterArticleOpened(callback: (HelpCenterArticle) -> Unit)
fun setOnLeadGenerated(callback: (String?) -> Unit)
fun setOnMessengerInitialized(callback: () -> Unit)
fun setOnProfilingQuestionAnswered(callback: (String, String) -> Unit)
fun setOnProfilingQuestionAsked(callback: (String) -> Unit)
fun setOnRealtimeVideoAnswered(callback: (RealtimeCall) -> Unit)
fun setOnRealtimeVideoCanceled(callback: () -> Unit)
fun setOnRealtimeVideoReceived(callback: (RealtimeCall) -> Unit)
fun setOnRealtimeVideoRejected(callback: () -> Unit)
fun setOnSurveyAnswered(callback: () -> Unit)
fun setOnSurveyPresented(callback: (Survey) -> Unit)
fun setOnSurveyRejected(callback: () -> Unit)Each callback has a corresponding remove method:
fun removeOnChatClosed()
fun removeOnChatOpened()
// ... and so on for all callbacksYou can also remove all callbacks at once:
fun removeAllCallbacks()The SDK includes a sample app project located in the sampleapp directory that demonstrates how to integrate and use the Customerly SDK. The sample app showcases various features including:
- Basic SDK initialization
- Messenger presentation
- User management
- Event tracking
- Message handling
- Notification handling
- Callback usage
To run the sample app:
- Open the project in Android Studio
- Navigate to the
sampleappmodule - Replace the
app_idinMainActivity.ktwith your Customerly app ID - Run the app on your device or emulator
The sample app provides a complete reference implementation of all SDK features and can be used as a starting point for your integration.
To release a new version of the SDK, you need to:
- Update the version in the
build.gradlefile - Update the version in the
README.mdfile - Push the changes to the
mainbranch - Create a new tag with the version number (e.g.
1.0.0) - The GitHub Actions workflow will build the SDK and release it to Maven Central
Copyright 2025-2026 Customerly Ltd.
This SDK is licensed under the Apache License 2.0 — you are free to use it in commercial and closed-source applications. See the LICENSE and NOTICE files for details.
Versions up to and including
1.1.0were published under the GNU GPLv3. The Apache 2.0 license applies from the next release onwards. If you are pinned to an older version, upgrade to pick up the more permissive terms.