SDKsReact Native
Set message receive option
Configure do-not-disturb and message reception options for a conversation using the OpenIM React Native SDK.
Configure the notification behavior or mute setting for an individual conversation:
await OpenIMSDK.setConversationRecvMessageOpt({
conversationID,
opt: MessageReceiveOptType.NotNotify,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | Target conversation ID to configure. |
opt | MessageReceiveOptType | Yes | Message reception option to apply. |
MessageReceiveOptType options include:
| Enum value | Value | Description |
|---|---|---|
MessageReceiveOptType.Normal | 0 | Receive messages and show notifications normally. |
MessageReceiveOptType.NotReceive | 1 | Reject incoming messages for this conversation. |
MessageReceiveOptType.NotNotify | 2 | Receive 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.
Was this page helpful?