setC2CReceiveMessageOpt

Introduction

Set the message receiving option for c2c messages from several users.

This method supports batch setting, you can set up to 30 users once.

The limit on rate for this method is at 5 times a second.

The receiving options can referring to ReceiveMsgOptEnum.

Parameter details

Parameter name Parameter type Required Description
userIDList string[] yes The user ID list.
opt ReceiveMsgOptEnum yes The message receiving option.

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, ReceiveMsgOptEnum } from 'react-native-tim-js';


const setC2CReceiveMessageOptRes = await TencentImSDKPlugin.v2TIMManager
    .getMessageManager()
    .setC2CReceiveMessageOpt(
        ['user1', 'user2'],
        ReceiveMsgOptEnum.V2TIM_NOT_RECEIVE_MESSAGE
    );
if (setC2CReceiveMessageOptRes.code === 0) {

}

results matching ""

    No results matching ""