deleteFromFriendList
Introduction
Delete friends from contact.
It's recommended that the amount of IDs needs to be lower than 100 once, to avoid the refusing from IM Server, which limits the packet size to 1MB.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
userIDList | string[] | yes | The list of user IDs to remove from contact. |
deleteType | FriendType | yes | The type of deleting friends. |
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 deleting operations results. |
Code example
import { TencentImSDKPlugin, FriendType } from 'react-native-tim-js';
const deleteFromFriendListRes = await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.deleteFromFriendList(
[],
FriendType.V2TIM_FRIEND_TYPE_BOTH
);
if (deleteFromFriendListRes.code == 0) {
deleteFromFriendListRes.data?.forEach((element) => {
element.resultCode;
element.resultInfo;
element.userID;
});
}