This is legacy documentation. It is no longer actively maintained. For current docs, visit cometchat.com/docs.

Key Concepts

Deprecated: The Ionic Cordova SDK is deprecated. For new Ionic/Cordova applications, please use the JavaScript SDK which provides full compatibility with Ionic applications.

CometChat Dashboard

The CometChat Dashboard enables you to create new apps (projects) and manage your existing apps.

How many apps to create?

Ideally, you should create two apps- one for development and one for production. And you should use a single app irrespective of the number of platforms.

Do not create separate apps for every platform; if you do, your users on different platforms will not be able to communicate with each other!

Auth & Rest API Keys

You can generate two types of keys from the dashboard.

Type Privileges Recommended Use
Auth Key The Auth Key can be used to create & login users. In your client side code (during development)
Rest API Key The Rest API Key can be used to perform any CometChat operation. In your server side code

Users

A user is anyone who uses CometChat.

UID

UID can be alphanumeric with underscore and hyphen. Spaces, punctuation and other special characters are not allowed.

Auth Token

Authentication

To allow a user to use CometChat, the user must log in to CometChat.

CometChat does not handle user management. You must handle user registration and login at your end. Once the user is logged into your app/site, you can log in the user to CometChat programmatically. So the user does not ever directly login to CometChat.

CometChat does not handle friends management. If you want to associate friends with your users, you must handle friends management in your app. Once two users are friends (i.e. they have accepted each other as friends), then you can associate them as friends in CometChat.

Typical Workflow

Your App Your Server CometChat
User registers in your app You store the user information in your database (e.g. ID, name, email, phone, location etc. in users table) You add the user to CometChat (only ID & name) using the Rest API
User logs in to your app You verify the credentials, login the user and retrieve the user ID You log in the user to CometChat using the same user ID programmatically
User sends a friend request You display the request to the potential friend No action required
User accepts a friend request You display the users as friends You add both the users as friends using the Rest API

User Roles

A role is a category for a group of similar users. For example, you may want to group your premium users using the role "Premium". You then use this to filter users or enable/disable features by writing conditional code.

User List

Groups

A group can be used for multiple users to communicate with each other on a particular topic/interest.

GUID

GUID can be alphanumeric with underscore and hyphen. Spaces, punctuation and other special characters are not allowed.

Types

CometChat supports three different types of groups:

Type Visibility Participation
Public All users Any user can choose to join
Password All users Any user with a valid password can choose to join
Private Only users part of the group Invited users will be auto-joined

Members

Once a participant joins a group, they become a member of the group. Members are part of the group indefinitely i.e. they will keep receiving messages, calls & notifications. To stop, the participant must either be kicked, banned or intentionally leave the group.

CometChat supports three different types of member scopes in a group:

Member Default Privileges
Admin Group creator is assigned Admin scope - Change scope of Group Members to admin, moderator or participant.
- Can add members to a group.
- Kick & Ban Participants/Moderators/Admins
- Send & Receive Messages & Calls
- Update group
- Delete group
Moderator - - Change scope of moderator or participant.
- Update group
- Kick & Ban Participants
- Send & Receive Messages & Calls
Participant Any other user is assigned Participant scope - Send & Receive Messages & Calls

Messaging

Any message in CometChat can belong to either one of the below categories

Category Description
message Any message belonging to the category message can belong to either one of the below types:
1. text
2. image
3. video
4. audio
5. file
custom Custom messages are an option available for developers to send custom data across to users/groups. To send any additional data that does not fit in the default categories and types provided by CometChat, you can use the custom messages.
action Action messages are system-generated messages. These can belong to either of the below types:
1. groupMember - when the action is performed on a group member
2. message - when the action is performed on a message
call These are call-related messages. These can belong to either one of the two types:
1. audio
2. video