Protected
Optional
_eventProtected
Static
TAGAccepts a group invitation.
The group ID.
The user ID of the inviter.
A description of the exception. See ChatError.
Accepts a join request.
Only the group owner or admin can call this method.
The group ID.
The ID of the user who sends a request to join the group.
A description of the exception. See ChatError.
Adds a group admin.
Only the group owner can call this method and group admins cannot.
The group ID.
The user ID of the admin to add.
A description of the exception. See ChatError.
Adds members to the allow list of the group.
Only the group owner or admin can call this method.
The group ID.
The user IDs of members to be added to the allow list of the group.
A description of the exception. See ChatError.
Adds a group listener.
The group listener to add.
Adds users to the group.
Only the group owner or admin can call this method.
The group ID.
The array of new members to add.
Optional
welcome: string(optional) The welcome message.
A description of the exception. See ChatError.
Blocks group messages.
The user that blocks group messages is still a group member, but cannot receive group messages.
The group ID.
A description of the exception. See ChatError.
Adds the user to the block list of the group.
Users will be first removed from the group they have joined before being added to the block list of the group. The users on the group block list cannot join the group again.
Only the group owner or admin can call this method.
The group ID.
The array of user IDs of members to be added to the block list.
A description of the exception. See ChatError.
Modifies the group description.
Only the group owner or admin can call this method.
The group ID.
The new group description.
A description of the exception. See ChatError.
Changes the group name.
Only the group owner or admin can call this method.
The group ID.
The new group name.
A description of the exception. See ChatError.
Transfers the group ownership.
Only the group owner can call this method.
The group ID.
The user ID of the new group owner.
A description of the exception. See ChatError.
Creates a group instance.
After the group is created, the data in the memory and database will be updated and multiple devices will receive the notification event and update the group to the memory and database.
You can set ChatGroupEventListener to listen for the event.
The options for creating a group. They are optional and cannot be null
. See ChatGroupOptions.
The options are as follows:
false
, indicating that invitees are automatically added to the group without their permission.The group name. It is optional. Pass null
if you do not want to set this parameter.
Optional
desc: stringThe group description. It is optional. Pass null
if you do not want to set this parameter.
Optional
inviteMembers: string[]The group member array. The group owner ID is optional. This parameter cannot be null
.
Optional
inviteReason: stringThe group joining invitation. It is optional. Pass null
if you do not want to set this parameter.
The created group instance.
A description of the exception. See ChatError.
Declines a group invitation.
The group ID.
The user ID of the inviter.
Optional
reason: stringThe reason for declining the invitation.
A description of the exception. See ChatError.
Declines a join request.
Only the group owner or admin can call this method.
The group ID.
The ID of the user who sends a request to join the group.
Optional
reason: stringThe reason of declining the join request.
A description of the exception. See ChatError.
Destroys the group instance.
Only the group owner can call this method.
The group ID.
A description of the exception. See ChatError.
Downloads the shared file of the group.
The group ID.
The ID of the shared file.
The local path of the shared file.
Optional
callback: ChatGroupFileStatusCallback(Optional) The file upload result callback.
A description of the exception. See ChatError.
Uses the pagination to get the allow list of the group from the server.
Only the group owner or admin can call this method.
The group ID.
The allow list of the group.
A description of the exception. See ChatError.
Gets the group announcement from the server.
All group members can call this method.
The group ID.
The group announcement.
A description of the exception. See ChatError.
Uses the pagination to get the group block list from the server.
Only the group owner or admin can call this method.
The group ID.
The number of group members on the block list that you expect to get on each page.
The page number, starting from 1.
The group block list.
A description of the exception. See ChatError.
Uses the pagination to get the shared files of the group from the server.
The group ID.
The number of shared files that you get on each page.
The page number, starting from 1.
The shared file list.
A description of the exception. See ChatError.
Gets the group information from the server.
The group ID.
Whether to get group member information:
- true
: Yes. This method can return information of at most 200 group members. To get information of all group members, you can call fetchMemberListFromServer.
- false
: No.
The group instance. The SDK returns undefined
if the group does not exist.
A description of the exception. See ChatError.
Gets the number of groups joined by the current user.
The list of joined groups of the current user.
A description of the exception. See ChatError.
Gets the list of groups that the current user has joined.
This method gets data from the server.
This method returns a group list which does not contain member information. If you want to update information of a group to include its member information, call fetchMemberListFromServer.
The number of groups that you expect to return on each page [1, 20].
The page number, starting from 0.
The list of groups that the current user joins.
A description of the exception. See ChatError.
Gets all custom attributes of a group member.
The group ID.
The user ID of the group member whose all custom attributes are retrieved.
The user attributes.
A description of the exception. See ChatError.
Uses the pagination to get the member list of the group from the server.
The group ID.
The number of group members that you expect to get on each page.
Optional
cursor: stringThe cursor position from which to start to get data. At the first method call, if you set cursor
as null
, the SDK gets the data in the reverse chronological order of when users join the group.
The group member list and the cursor for the next query. See ChatCursorResult.
A description of the exception. See ChatError.
Gets custom attributes of multiple group members by attribute key.
The group ID.
The array of user IDs of group members whose custom attributes are retrieved.(limitation is ten. More than callback error. )
Optional
attributeKeys: string[]The array of keys of custom attributes to be retrieved.
The users attributes.
A description of the exception. See ChatError.
Uses the pagination to get the mute list of the group from the server.
Only the group owner or admin can call this method.
The group ID.
The number of muted members that you expect to get on each page.
The page number, starting from 1.
The group mute list.
A description of the exception. See ChatError.
Gets public groups from the server with pagination.
The number of public groups that you expect on each page.
Optional
cursor: stringThe cursor position from which to start to get data. At the first method call, if you set cursor
as null
, the SDK gets the data in the reverse chronological order of when groups are created.
The group list and the cursor for the next query. See ChatCursorResult.
A description of the exception. See ChatError.
Gets the group instance from the memory by group ID.
The group ID.
The group instance. The SDK returns undefined
if the group does not exist.
A description of the exception. See ChatError.
Invites users to join the group.
This method works only for groups with the following styles:
PrivateOnlyOwnerInvite
style: Only the group owner can invite users to join the group.PrivateMemberCanInvite
style: Each group member can invite users to join the group.PublicJoinNeedApproval
style: Each group member can invite users to join the group and users can join a group only after getting approval from the group owner or admins.The group ID.
The array of user IDs of new members to invite.
Optional
reason: stringThe invitation reason.
A description of the exception. See ChatError.
Gets whether the member is on the allow list of the group.
The group ID.
Whether the current user is on the allow list of the group.
true
: Yes.false
: No.A description of the exception. See ChatError.
Joins a public group.
For a group that requires no authentication,users can join it freely without obtaining permissions from the group owner or admin.
For a group that requires authentication, users need to wait for the group owner or admin to agree before joining the group. For details, see ChatGroupStyle.
The group ID.
A description of the exception. See ChatError.
Leaves a group.
The group ID.
A description of the exception. See ChatError.
Mutes all members.
Only the group owner or admin can call this method.
The group ID.
A description of the exception. See ChatError.
Mutes group members.
Only the group owner or admin can call this method.
The group ID.
The list of user IDs of members to mute.
The mute duration in milliseconds. It is a reserved parameter.
A description of the exception. See ChatError.
Removes a group admin.
Only the group owner can call this method.
The group ID.
The user ID of the group admin to remove.
A description of the exception. See ChatError.
Removes members from the allow list of the group.
Only the group owner or admin can call this method.
The group ID.
The user IDs of members to be removed from the allow list of the group.
A description of the exception. See ChatError.
Removes the group listener.
The group listener to remove.
Removes a shared file of the group.
Group members can delete their own uploaded files. The group owner or admin can delete all shared files.
The group ID.
The ID of the shared file.
A description of the exception. See ChatError.
Removes a member from the group.
Only the group owner or admin can call this method.
The group ID.
The user ID of the member to be removed.
A description of the exception. See ChatError.
Requests to join a group.
You can call this method to only join public groups requiring authentication, i.e., groups with the style of ChatGroupStyle.PublicJoinNeedApproval.
The group ID.
Optional
reason: stringThe reason for requesting to join the group.
A description of the exception. See ChatError.
Sets custom attributes of a group member.
The group ID.
The array of user IDs of group members whose custom attributes are retrieved.(limitation is ten. More than callback error. )
A description of the exception. See ChatError.
Unblocks group messages.
The group ID.
A description of the exception. See ChatError.
Removes users from the group block list.
Only the group owner or admin can call this method.
The group ID.
The user IDs of members to be removed from the group block list.
A description of the exception. See ChatError.
Unmutes all group members.
Only the group owner or admin can call this method.
The group ID.
A description of the exception. See ChatError.
Unmutes group members.
Only the group owner or admin can call this method.
The group ID.
The array of user IDs of members to be unmuted.
A description of the exception. See ChatError.
Updates the group announcement.
Only the group owner or admin can call this method.
The group ID.
The group announcement.
A description of the exception. See ChatError.
Updates the group extension field.
Only the group owner or admin can call this method.
The group ID.
The updated group extension field.
A description of the exception. See ChatError.
Uploads the shared file to the group.
When a shared file is uploaded, the upload progress callback will be triggered.
The group ID.
The local path of the shared file.
Optional
callback: ChatGroupFileStatusCallback(Optional) The file upload result callback.
A description of the exception. See ChatError.
Protected
Static
_callProtected
Static
checkProtected
Static
handleOptional
callback: ChatGroupFileStatusCallbackProtected
Static
handleOptional
callback: ChatMessageStatusCallback
The group manager class, which defines how to manage groups, like group creation and destruction and member management.