appId
) is generated. This appId
will be required when integrating CometChat within your app.uid
.uid
is typically the primary ID of the user from your database.uid
can be alphanumeric with underscore (_
) and hyphen (-
). Spaces, punctuation and other special characters are not allowed.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 |
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 |
guid
.guid
is typically the primary ID of the group from your database.guid
.guid
can be alphanumeric with underscore (_
) and hyphen (-
). Spaces, punctuation and other special characters are not allowed.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 |
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 | A participant can be made a 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 |
message
can be used to send messages of the following types:
text
- A plain text messageimage
- An image messagevideo
- A video messageaudio
- An audio messagefile
- A file messagecustom
category, there are no predefined types.custom
, the developers can set their own type to uniquely identify the custom message.location
.action
category can further be classified into one of the below types:
groupMember
- action performed on a group member.message
- action performed on a message.action
which actually determine the action that has been performed For the type groupMember
the action can be either one of the below:
joined
- when a group member joins a groupleft
- when a group member leaves a groupkicked
- when a group member is kicked from the groupbanned
- when a group member is banned from the groupunbanned
- when a group member is unbanned from the groupadded
- when a user is added to the groupscopeChanged
- When the scope of a group member is changed.message
, the action can be either one of the below:
edited
- when a message is edited.deleted
- when a message is deleted.call
are Calling related messages. These can belong to either one of the 2 types
audio
video
initiated
- when a is initiated to a user/groupongoing
- when the receiver of the call has accepted the callcanceled
- when the call has been canceled by the initiator of the callrejected
- when the call has been rejected by the receiver of the callunanswered
- when the call was not answered by the receiver.busy
- when the receiver of the call was busy on another call.ended
- when the call was successfully completed and ended by either the initiator or receiver.interactive
are useful where users can perform some action without leaving the conversation. Interactive messages can be of the following types:
form
card
scheduler
customInteractive