addFriendsToFriendGroup
Introduction
Add friends to a group.
Parameter details
Parameter name |
Parameter type |
Required |
Description |
groupName |
string |
yes |
The name of the group. |
userIDList |
string[] |
yes |
The list of user IDs needs 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 addFriendsToFriendGroupRes = await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.addFriendsToFriendGroup(
'groupName',
[]
);
if (addFriendsToFriendGroupRes.code === 0) {
addFriendsToFriendGroupRes.data?.forEach((element) => {
element.resultCode;
element.resultInfo;
element.userID;
});
}