accept

Introduction

The recipient accepts the invitation.

Parameter details

Parameter name Parameter type Required Description
inviteID string yes The ID of the invitation.
data string no The custom data carried by the acceptance message.

Returned template

V2TimCallback

{
    code : number
    desc : 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.

Code example

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);

results matching ""

    No results matching ""