createFriendGroup

Introduction

Create a new friend group.

Users can create friend groups in some cases, like separate to 'Work groups', 'Social groups', with this method.

Parameter details

Parameter name Parameter type Required Description
groupName string yes The name of the group.
userIDList string[] no The list of user IDs to be added to the group.

Returned template

V2TimValueCallback<V2TimFriendOperationResult[]>

{
    code : number
    desc : string
    data : V2TimFriendOperationResult[]
}

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.
data V2TimFriendOperationResult[] The list of operation result.

Code example

import { TencentImSDKPlugin } from 'react-native-tim-js';

const createFriendGroupRes = await TencentImSDKPlugin.v2TIMManager
    .getFriendshipManager()
    .createFriendGroup(
        'groupName',
        []
    );
if (createFriendGroupRes.code == 0) {

    createFriendGroupRes.data?.forEach((element) => {
        element.resultCode;
        element.resultInfo;
        element.userID;
    });
}

results matching ""

    No results matching ""