logo
On this page

Manage group info


ZEGOCLOUD's In-app Chat (the ZIM SDK) provides the capability of group information management, allowing you to get or modify group info, such as group name, nickname in the group, group avatar, group notice, and more.

Warning
  • Before you use this feature, you must join a group first. To join a group, refer to the Chapter Join a group of Manage groups.
  • All in-group members (group owner included) can use this feature.

Get group info

To know the detailed info of the group you joined, call the QueryGroupInfo method.

You will receive the group info through the callback ZIMGroupInfoQueriedCallback after the query succeeds.

SampleCode
// Group members query group information, such as group name, group nickname, group announcement, etc.
ZIM.GetInstance().QueryGroupInfo("groupID", (ZIMGroupFullInfo groupInfo, ZIMError errorInfo) =>
{
    // You can get the result of querying group information by accessing errorInfo
});
1
Copied!

Modify the group name

To modify the group name after joining a group, call the UpdateGroupName method.

All group members receive a notification through the callback OnGroupNameUpdated after the group name is modified successfully.

SampleCode
// Group members modify group name
// groupName is a string with a maximum of 64 bytes, with no special character restrictions.
ZIM.GetInstance().UpdateGroupName("newGroupName", "groupID", (string groupID, string groupName, ZIMError errorInfo) => { });
1
Copied!

Modify the group avatar

After logging in and joining a group, if a user wants to modify the avatar of the group they have joined, they can do so by calling the UpdateGroupAvatarUrl interface to modify the group avatar.

After a successful modification, all group members will receive a notification through OnGroupAvatarUrlUpdated.

SampleCode
// Group members modify group avatar
// URL has a maximum of 500 bytes, with no special character restrictions.
ZIM.GetInstance().UpdateGroupAvatarUrl("groupAvatarUrl", "groupID", (string groupID, string groupAvatarUrl, ZIMError errorInfo) => { });
1
Copied!

Modify the group notice

To modify the group notice after joining a group, call the UpdateGroupNotice method.

All group members receive a notification through the callback OnGroupNoticeUpdated when the group notice is modified successfully.

SampleCode
// Group members modify group notice
ZIM.GetInstance().UpdateGroupNotice("new_group_notice", "group_id", (string groupID, string groupNotice, ZIMError errorInfo) =>
    {
        // Use errorInfo.code to get the result of modifying group notice     
    }
);
1
Copied!

Previous

Manage groups

Next

Manage group properties