launch
method with the following keys:
Parameter | Description |
---|---|
widgetID | ID of the widget can be accessed from the CometChat dashboard |
target | ID of the div tag where CometChat Widget will appear |
roundedCorners | Boolean value that enables/disables rounded corners. |
height | Height of the widget |
width | Width of the widget |
defaultID | To show a default logged in user or group in your chat a.Use UID of a user for one-on-one conversations b.Use GUID for group conversations |
defaultType | Either user or group depending upon the defaultID |
DomContentLoaded
event fired by the window object. You can break down these steps on different events of your choice to have a more controlled flow of initializing and launching the Chat Widget.Parameter | Description |
---|---|
widgetID | ID of the widget can be accessed from the CometChat dashboard |
docked | Boolean value to show the enable the docked view |
alignment | Can be set to left or right |
roundedCorners | Boolean value that enables/disables rounded corners |
height | Height of the widget |
width | Width of the widget |
defaultID | To show a default logged in user or group in your chat a.Use UID of a user for one - one conversations b.Use GUID for group conversations |
defaultType | Either user or group depending upon the defaultID |
target
if you intend to launch another instance of Chat Widget.Parameter | Description | Type |
---|---|---|
FLAG | Value could be true or false true will open the chat window false will close the chat window. | Required |
Parameter | Description | Type |
---|---|---|
UID | The ID of the user you want to chat with | Required |
Parameter | Description | Type |
---|---|---|
GUID | The ID of the group you want to chat with | Required |
Parameter | Description | Type |
---|---|---|
UID | The ID of the user you want to initiate a call with. | Required |
Parameter | Description | Type | |
---|---|---|---|
GUID | The ID of the group you want to initiate a call with | Required |
Parameter | Description | Type |
---|---|---|
LANGUAGE_CODE | The language code the texts to be translated into | Required |
createOrUpdateUser()
method on the CometChatWidget class.
It might happen that the user already exists. In that case, this method updates the user details. It can be used to change the user’s name on-the-fly.
The method is as follows:
Parameter | Description | Type |
---|---|---|
UID | The ID of the user to be created and log in | Required |
NAME | The username associated with the user | Required |
AVATAR_URL | URL to profile picture of the user | Optional |
PROFILE_LINK | URL to profile page | Optional |
createOrUpdateGroup()
method on the CometChatWidget class.
It might happen that the group already exists. In that case, this method updates the group details. It can be used to change the group’s name and type on the fly.
Parameter | Description | Type |
---|---|---|
GUID | The group will be created with the mentioned ID | Required |
GROUP_NAME | The name associated with the group being created | Required |
GROUP_TYPE | The type of group that you want to create. Type of the group can be: 1. Public 2. Password 3. Private | Required |
PASSWORD | The group password when groupType is set to ‘Password’ | Required |
ICON_URL | An URL to group icon | Optional |
logout()
method of the CometChatWidget
class.
Parameter | Description |
---|---|
widgetID | ID of the widget can be accessed from the CometChat dashboard |
target | For embedded layout, pass the ID of the div tag where CometChat Widget will appear ID of the div tag where CometChat Widget will appear |
docked | For docked layout, use the docked parameter as a boolean value to show the enable the docked view |
roundedCorners | Boolean value that enables/disables rounded corners. |
height | Height of the widget |
width | Width of the widget |
defaultID | To show a default logged in user or group in your chat a.Use UID of a user for one - one conversations b.Use GUID for group conversations |
defaultType | Either user or group depending upon the defaultID |