Browse SDKs · React Native
SDKsReact Native

Set conversation message reception

Set the message reception option for a conversation.

Copy

Call setConversationRecvMessageOpt() to set the message reception option for one conversation.

await OpenIMSDK.setConversationRecvMessageOpt({
  conversationID,
  opt: MessageReceiveOptType.NotNotify,
});

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesConversation ID to update.
optMessageReceiveOptTypeYesMessage reception option for the conversation.

Common MessageReceiveOptType values are:

Enum valueNumeric valueDescription
MessageReceiveOptType.Normal0Receive messages normally and allow notifications.
MessageReceiveOptType.NotReceive1Do not receive messages from this conversation.
MessageReceiveOptType.NotNotify2Receive messages without notifications.

Return result

After the call completes, the conversation's recvMsgOpt is updated. Changes in the conversation list are delivered through OnConversationChanged; see Retrieve the conversation list. For the account-level default, see Set global message reception.