acceptFriendApplication
功能介绍
同意好友申请
参数详解
返回模板
V2TimValueCallback<V2TimFriendOperationResult>
{
code : number
desc : string
data : {
resultCode : number
resultInfo : string
userID : string
}
}
返回值详解
代码示例
import {
TencentImSDKPlugin,
FriendResponseTypeEnum,
FriendApplicationTypeEnum,
} 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 acceptFriendApplicationRes =
await TencentImSDKPlugin.v2TIMManager
.getFriendshipManager()
.acceptFriendApplication(
FriendResponseTypeEnum.V2TIM_FRIEND_ACCEPT_AGREE,
element.type as FriendApplicationTypeEnum,
''
);
if (acceptFriendApplicationRes.code === 0) {
acceptFriendApplicationRes.data?.resultCode;
acceptFriendApplicationRes.data?.resultInfo;
acceptFriendApplicationRes.data?.userID;
}
}
);
}