refuseFriendApplication
Introduction
Refuse the friend application.
Parameter details
Parameter name |
Parameter type |
Required |
Description |
type |
FriendApplicationTypeEnum |
yes |
The type of refusing. |
userID |
string |
yes |
The ID of the user been refused. |
Returned template
V2TimValueCallback<V2TimFriendOperationResult>
{
code : number
desc : string
data : {
resultCode : number
resultInfo : string
userID : 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. |
data |
V2TimFriendOperationResult |
The result of the operation. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const getFriendApplicationListRes = await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.getFriendApplicationList();
if (getFriendApplicationListRes.code === 0) {
getFriendApplicationListRes.data?.unReadCount;
getFriendApplicationListRes.data?.friendApplicationList?.forEach(
(element) => {
const refuseFriendApplicationRes =
await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.refuseFriendApplication(
element!.type,
'userID'
);
if (refuseFriendApplicationRes.code === 0) {
refuseFriendApplicationRes.data?.resultCode;
refuseFriendApplicationRes.data?.resultInfo;
refuseFriendApplicationRes.data?.userID;
}
}
);
}