cancel
功能介绍
邀请方取消邀请
参数详解
参数名称 |
参数类型 |
是否必填 |
描述 |
inviteID |
string |
是 |
被取消邀请的id |
data |
string |
否 |
取消邀请时附带的定义消息 |
返回模板
V2TimCallback
{
code : number
desc : string
}
返回值详解
名称 |
数值类型 |
描述 |
code |
number |
请求结果错误码 |
desc |
string |
请求结果描述符 |
代码示例
import { TencentImSDKPlugin } from 'react-native-tim-js';
const listener = {
onInvitationCancelled: (inviteID, inviter, data) => {
},
onInvitationTimeout: (inviteID, inviteeList) => {},
onInviteeAccepted: (inviteID, invitee, data) => {},
onInviteeRejected: (inviteID, invitee, data) => {},
onReceiveNewInvitation: (
inviteID,
inviter,
groupID,
inviteeList,
data
) => {},
};
TencentImSDKPlugin.v2TIMManager
.getSignalingManager()
.addSignalingListener(listener);
const cancelRes = await TencentImSDKPlugin.v2TIMManager
.getSignalingManager()
.cancel(
'inviteID',
''
);
if (cancelRes.code === 0) {
}