setGroupMemberRole

Introduction

Set the role of a member in the group.

The group owner can call setGroupMemberRole to change the role of a member of a public group (Public) or meeting group (Meeting). Roles available for changing are ordinary member and group admin.

After a member is set as group admin, all group members (including the new admin) receive the OnGrantAdministratorCallback callback.

After the admin role is removed for a member, all group members (including the member with admin role removed) receive the OnRevokeAdministratorCallback callback.

Parameter details

Parameter name Parameter type Required Platform Description
groupID String yes All The group ID.
userID String yes All The target user ID.
role GroupMemberRoleTypeEnum yes All The new role type of a group member.

Returned template

V2TimCallback

{
    code : int
    desc : String
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the error. It will be empty if success.

Code example

    V2TimCallback setGroupMemberRoleRes = await TencentImSDKPlugin.v2TIMManager
        .getGroupManager()
        .setGroupMemberRole(
          groupID: "groupID",
          userID: "userID",
          role: GroupMemberRoleTypeEnum.V2TIM_GROUP_MEMBER_ROLE_ADMIN
          );
    if (setGroupMemberRoleRes.code == 0) {
    }

results matching ""

    No results matching ""