Browse SDKs · React Native
Platform
SDKsReact Native

Set message receive option

Configure do-not-disturb and message reception options for a conversation using the OpenIM React Native SDK.

Copy

Configure the notification behavior or mute setting for an individual conversation:

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

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesTarget conversation ID to configure.
optMessageReceiveOptTypeYesMessage reception option to apply.

MessageReceiveOptType options include:

Enum valueValueDescription
MessageReceiveOptType.Normal0Receive messages and show notifications normally.
MessageReceiveOptType.NotReceive1Reject incoming messages for this conversation.
MessageReceiveOptType.NotNotify2Receive messages silently without notification banners or sounds (Mute).

Return value

A resolved Promise confirms that the conversation message reception option was updated on the server.

The update triggers the OnConversationChanged event. Use conversationID to identify the conversation in your state store and update recvMsgOpt to toggle mute badges or silent indicators. For account-wide defaults, see Set global message reception. For event registration, see Retrieve conversation list.