accept
功能介绍
接收方接受邀请
参数详解
参数名称 |
参数类型 |
是否必填 |
描述 |
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: async (
inviteID,
inviter,
groupID,
inviteeList,
data
) => {
const acceptRes = await TencentImSDKPlugin.v2TIMManager
.getSignalingManager()
.accept(
inviteID,
''
);
if (acceptRes.code == 0) {
}
},
};
TencentImSDKPlugin.v2TIMManager
.getSignalingManager()
.addSignalingListener(listener);