Mobile SDK

COMETCHAT MOBILE SDK

The easiest way to add messaging to your app

Add voice, video, text to your platform and get the complete flexibility to customize your UI with CometChat Pro’s chat and calling SDKs and APIs . Designed for Developers.

OR

Use CometChat Go’s instant SDKs to get a plug and play chat solution for your platform with pre-built UI and minimum customization. Integrate voice, video, text chat in minutes. Designed for product managers.

PLATFORMS

Out-of-the-box support for your favorite platforms

We’ve done most of the job for you

A ready to integrate SDK with complete Source Code for UI. Developers can easily build on top of our existing UI and expand on CometChat’s functionality.

+

OPTIONS

Three ways to add CometChat

The full shebang

The SDK gives you access to all of the features CometChat has to offer. The simple mobile chat API has an intuitive flow which makes the entire process hassle-free.

A private chat popup

A fluid chat pop-up allows users to access CometChat allowing them to have one on one chats, share files, have Video Calls and much more with other users online.

A group chat popup

Create more interaction and collaboration using CometChat’s group chat pop-up. Users can create public, password protected and invitation-only groups.

SDK CODE SNIPPET

Designed for developers to take control

Simple integration and support for all mobile and app development platforms.

iOS Chat SDK

CometChat SDK seamlessly integrates with your existing application and lets you add chat functionality to your mobile app.

The CometChat iOS SDK lets you integrate CometChat with your existing app.

CometChat *cometchat =  [[CometChat alloc] init];
[cometChat initializeCometChat];

                          
[cometChat login];

                          
readyUIFIle *cometchatui==  [[readyUIFIle alloc] init];
[cometchatui launchCometChat];

                          

Android Chat SDK

CometChat SDK seamlessly integrates with your existing application and lets you add chat functionality to your mobile app.

The CometChat Android SDK lets you integrate CometChat with your existing app.

CometChat cometChat = CometChat.getInstance();
cometChat.initializeCometChat();

                          
cometChat.login(userID);

                          
cometChat.launchCometChat();

                          

Cordova Chat plugin

CometChat SDK seamlessly integrates with your existing application and lets you add chat functionality to your mobile app.

CometChat SDK now offers support to app development in Cordova. With our Cordova chat plugin you can use Ready UI API’s in your Cordova app .

CCCometChat.getInstance();
CCCometChat.initializeCometChat();

                          
CCCometChat.login();

                          
CCCometChat.launchCometChat(bool,success(data),error(data));

                          

Ionic Chat Plugin

CometChat SDK seamlessly integrates with your existing application and lets you add chat functionality to your mobile app.

CometChat SDK now offers support to app development in Cordova. You can use Ready UI APIs using our Cordova plugin.

CCCometChat.getInstance();
CCCometChat.initializeCometChat();

                          
CCCometChat.login();

                          
CCCometChat.launchCometChat(bool,success(data),error(data));

                          

Xamarin Chat plugin

CometChat SDK seamlessly integrates with your existing application and lets you add chat functionality to your mobile app.

CometChat SDK now offers support for app development in Xamarin. You can use Ready UI APIs using our Xamarin binding library.

CometChat cometchat=new CometChat();
cometchat.InitializeCometChat();

                          
cometchat.Login();

                          
readyUIFIle rr = new readyUIFIle();
rr.LaunchCometChat();

                          
var GUID = "GUID";
var password = "";
var groupType = CometChat.GROUP_TYPE.PUBLIC;

CometChat.joinGroup(GUID, groupType, password).then(
 group => {
  console.log("Group joined successfully:", group);
 },
 error => {
  console.log("Group joining failed with exception:", error);
 }
);

                    
private String GUID = "GUID";
private String groupType = CometChatConstants.GROUP_TYPE_PUBLIC;
private String password = "";

CometChat.joinGroup(GUID, groupType, password, new CometChat.CallbackListener() {
  @Override
  public void onSuccess(String successMessage) {
    Log.d(TAG, "Group joined successfully");
  }
  @Override
  public void onError(CometChatException e) {
    Log.d(TAG, "Group joining failed with exception: " + e.getMessage());
  }
});

                    
let guid = "SUPERGROUP1";
let password = ""; // mandatory in case of protected group

CometChat.joinGroup(GUID: guid, groupType: .public, password: nil, onSuccess: { (Group) in

  // Success
  print("Group joined successfully: " + Group!.stringValue())

}) { (error) in

  // Failure
  print("Group joining failed with exception:" + error!.ErrorDescription);
}

                    
var listenerID = "UNIQUE_LISTENER_ID";

CometChat.addMessageListener(
 listenerID,
 new CometChat.MessageListener({
  onTextMessageReceived: textMessage => {
   console.log("Text message successfully", textMessage);
   // Handle text message
  },
  onMediaMessageReceived: mediaMessage => {
   console.log("Media message received successfully",  mediaMessage);
   // Handle media message
  }
 })
);

                    
private String listenerID = "UNIQUE_LISTENER_ID";

CometChat.addMessageListener(listenerID, new CometChat.MessageListener() {
  @Override
  public void onTextMessageReceived(TextMessage textMessage) {
    Log.d(TAG, "Text message received successfully: " + textMessage.toString());
  }
  @Override
  public void onMediaMessageReceived(MediaMessage mediaMessage) {
    Log.d(TAG, "Media message received successfully: " + mediaMessage.toString());
  }
});

                    
extension ViewController: CometChatMessageDelegate {

  func onTextMessageReceived(textMessage: TextMessage ? , error : CometChatException ? ) {

    // received a new messsage of type text
    let receivedMessage = (textMessage as ? TextMessage);
    print("Message received successfully: " + receivedMessage!.stringValue())

  }

  func onMediaMessageReceived(mediaMessage: MediaMessage ? , error : CometChatException ? ) {

    // received a new message of type media
    let receivedMessage = (mediaMessage as ? MediaMessage);
    print("Message received successfully: " + receivedMessage!.stringValue())

  }
}

                    
var receiverID = "UID";
var messageText = "Hello world!";
var messageType = CometChat.MESSAGE_TYPE.TEXT;
var receiverType = CometChat.RECEIVER_TYPE.USER;

var textMessage = new CometChat.TextMessage(receiverID, messageText, messageType, receiverType);

CometChat.sendMessage(textMessage).then(
  message => {
    console.log("Message sent successfully:", message);
    // Text Message Sent Successfully
  },
  error => {
    console.log("Message sending failed with error:", error);
  }
);

                    
private String receiverID = "UID";
private String messageText = "Hello world!";
private String messageType = CometChatConstants.MESSAGE_TYPE_TEXT;
private String receiverType = CometChatConstants.RECEIVER_TYPE_USER;

TextMessage textMessage = new TextMessage(receiverID, messageText, messageType, receiverType);

CometChat.sendMessage(textMessage, new CometChat.CallbackListener() {
  @Override
  public void onSuccess(TextMessage textMessage) {
    Log.d(TAG, "Message sent successfully: " + textMessage.toString());
  }
  @Override
  public void onError(CometChatException e) {
    Log.d(TAG, "Message sending failed with exception: " + e.getMessage());
  }
});

                    
let receiverID = "SUPERHERO2"
let text = "Hello"

let textMessage = TextMessage(receiverUid: receiverID, text: text, messageType: .text, receiverType: .user)

CometChat.sendTextMessage(message: textMessage, onSuccess: { (message) in

  // success
  let sentMessage = (message as ? TextMessage);
  print("Message sent successfully: " + sentMessage!.stringValue())

}) { (error) in

  // error
  print("Message sending failed with exception:  " + error!.ErrorDescription);
}

                    
var limit = 30;
var usersRequest = new CometChat.UsersRequestBuilder().setLimit(limit).build();

usersRequest.fetchNext().then(
  userList => {
    /* userList will be the list of User class. */
    console.log("User list received:", userList);
    /* retrived list can be used to display contact list. */
  },
  error => {
    console.log("User list fetching failed with error:", error);
  }
);

                    
private UsersRequest usersRequest = null;
private int limit = 30;

usersRequest = new UsersRequest.UsersRequestBuilder().setLimit(limit).build();

usersRequest.fetchNext(new CometChat.CallbackListener>() {
  @Override
  public void onSuccess(List  list) {
    Log.d(TAG, "User list received: " + list.size());
  }
  @Override
  public void onError(CometChatException e) {
    Log.d(TAG, "User list fetching failed with exception: " + e.getMessage());
  }
});

                    
let limit = 20;

let usersRequest = UsersRequest.UsersRequestBuilder(limit: limit).build();

usersRequest.fetchNext(onSuccess: { (users) in

  // Received user list success
  for user in users {

    // user
     print("User : " + user.stringValue())
  }

}) { (error) in

  // Error
  print("User list fetching failed with exception: " + error.ErrorDescription);
}

                    

FEATURES

Supercharge your app

Grant your app the Super Power of Communication and Collaboration with the CometChat SDK.

Seamless Integration

The CometChat SDK seamlessly integrates with your existing app, thus providing endless functionalities.

Easy API

Easy API allows developers to access the functionality of software modules through well-defined data structures.

No external dependency

The mobile chat SDK is a standalone package designed to work out of the box and does not require you to include or refer any other library.

Ready to get started? Start building today!

CometChat