CometChat Developer 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    

User Management

Users can be created using one of the below 3 methods:

On-the-fly

To create the users on the go, we provide a method in the Xamarin SDK called CreateUser(). You can use the method to create a user as shown in the below code sample:

String UID = "DEMO123";  // Required
String name = "Your Name";  // Required
String avatarURL = "";
String profileURL = "";
String role = "";
Context context;

cometChat.CreateUser(activity, UID, name, avatarURL, profileURL, role, new CometChatCallback((JSONObject obj) =>{
  /* codeblock on success*/

}, (JSONObject obj) =>{
  /* codeblock on failure*/

}));
String UID = "DEMO123";  // Required
String name = "Your Name";  // Required
String avatarURL = "";
String profileURL = "";
String role = "";

// Add code for CreateUser iOS

This method will create the user with the parameters passed if everything is successful and return the details of the user created in the successCallback.
In case the user already exists, it will return an error message saying "User already exists".

Via Restful API

The second option available to create a user is using the Restful APIs we provide for user management.

Via Admin Panel

The third and the most simple option to create users is by creating the users via the CometChat Administration Panel. All you need to do is login to the CometChat Admin Panel, and navigate to the Users section in the left pane.