refuseFriendApplication
Introduction
Refuse the friend application.
Parameter details
Parameter name |
Parameter type |
Required |
Platform |
Description |
type |
FriendApplicationTypeEnum |
yes |
All |
The type of refusing. |
userID |
String |
yes |
All |
The ID of the user been refused. |
Returned template
V2TimValueCallback<V2TimFriendOperationResult>
{
code : int
desc : String
data : {
resultCode : int
resultInfo : String
userID : String
}
}
Return value details
name |
type |
description |
code |
int |
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
V2TimValueCallback<V2TimFriendApplicationResult>
getFriendApplicationListRes = await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.getFriendApplicationList();
if (getFriendApplicationListRes.code == 0) {
getFriendApplicationListRes.data?.unreadCount;
getFriendApplicationListRes.data?.friendApplicationList
?.forEach((element) async {
V2TimValueCallback<V2TimFriendOperationResult>
refuseFriendApplicationRes = await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.refuseFriendApplication(
type: FriendApplicationTypeEnum
.values[element!.type],
userID: "");
if (refuseFriendApplicationRes.code == 0) {
refuseFriendApplicationRes.data?.resultCode;
refuseFriendApplicationRes.data?.resultInfo;
refuseFriendApplicationRes.data?.userID;
}
});
}