transferGroupOwner
Introduction
Transfer the group owner to another member.
The group owner can call transferGroupOwner to transfer the ownership of group to other group members.
After the group ownership is transferred, all group members receive the OnGroupInfoChanged, where the type of V2TIMGroupChangeInfo is GroupChangeInfoType.V2TIM_GROUP_INFO_CHANGE_TYPE_OWNER and the value is the UserID of the new group owner.
Only the group owner can transfer ownership to other members for Work/Public/Meeting groups.
Do not works for AVChatRoom.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
groupID | string | yes | The group ID. |
userID | string | yes | The user ID of the new group owner. |
Returned template
V2TimCallback
{
code : number
desc : string
}
Return value details
name | type | description |
---|---|---|
code | number | Request result: Error codes. 0 means success. |
desc | string | The description of the error. It will be empty if success. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const transferGroupOwnerRes = await TencentImSDKPlugin.v2TIMManager
.getGroupManager()
.transferGroupOwner('groupID', 'userID');
if (transferGroupOwnerRes.code === 0) {
}