CometChat Go Documentation

Welcome Ninja!

You'll find comprehensive guides and documentation to help you start working with CometChat as quickly as possible. Let's jump right in!

Get Started    

To add CometChat to your Android app, please perform the following.

Update Your Gradle File

Add the below lines in Project level build.gradle file in allprojects repositories section

allprojects {
 repositories {
            url ''

Add Dependencies

Add the below dependencies in Module level build.gradle file in dependencies section

dependencies {
    compile 'com.inscripts:CometChat:7.33.+'
    compile 'com.inscripts:CometChatUI:7.33.+'

Enable Multidex

To enable Multidex please add the following line to the defaultConfig element of the build.gradle file of your application. To know more about Multidex applications and why it is necessary, please click here.

Also, add the dexOptions and the packagingOptions sections as shown below

android {
  defaultConfig {
   	multiDexEnabled true
	dexOptions {
   	javaMaxHeapSize "2048M"

  packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'

Initialize the SDK

Initialization binds the SDK to your app and syncs the various basic parameters required for the CometChat SDK to function.

private String licenseKey = "COMETCHAT-XXXXX-XXXXX-XXXXX-XXXXX"
private String apiKey = "xxxxxxxxxxxxxxxxxxxxxx";

CometChat cometChat = CometChat.getInstance(context);
cometChat.initializeCometChat("", licenseKey, apiKey, true, new Callbacks() {
	public void successCallback(JSONObject jsonObject) {
	public void failCallback(JSONObject jsonObject) {


The initializeCometChat() must only be called once in the entire scope of the app. We suggest you call the initializeCometChat() method on app startup preferably in the onCreate() method of the Application class.

Updated 7 months ago


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.