inviteUserToGroup

Introduction

Invite other user to the group.

All the group members, including self, will receive callback of OnMemberInvited, that some tips on screen can be made.

This method works for Work group only.

While you can use API on server side, to invite other members to Meeting and Public group.

AVChatRoom is not available for invitation.

Parameter details

Parameter name Parameter type Required Description
groupID string yes The group ID.
userList string[] yes The list of user IDs to invite.

Returned template

V2TimValueCallback<V2TimGroupMemberOperationResult[]>

{
    code : number
    desc : string
    data : V2TimGroupMemberOperationResult[]
}

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.
data V2TimGroupMemberOperationResult[] The list of invitation results.

Code example

import { TencentImSDKPlugin } from 'react-native-tim-js';

const inviteUserToGroupRes = await TencentImSDKPlugin.v2TIMManager
    .getGroupManager()
    .inviteUserToGroup(
        'groupID',
        []
    );
if (inviteUserToGroupRes.code == 0) {

    inviteUserToGroupRes.data?.forEach((element) => {
        element.memberID;



        element.result;
    });
}

results matching ""

    No results matching ""