Browse SDKs · Flutter
Platform
SDKsFlutter

Set conversation message receive option

Configure message reception and do-not-disturb preferences for an individual conversation using the OpenIM Flutter SDK.

Copy

Configure notification reception and do-not-disturb (DND) behavior for a specified conversation:

Parameters

ParameterTypeRequiredDescription
conversationIDStringYesTarget conversation ID.
reqConversationReqYesConversation modification request. Pass the desired option in recvMsgOpt.

Code example

await OpenIM.iMManager.conversationManager.setConversation(
  conversationID,
  ConversationReq(recvMsgOpt: ReceiveMessageOpt.notNotify),
);

ReceiveMessageOpt enum values:

Enum OptionValueBehavior
ReceiveMessageOpt.receive0Receive messages normally with system notification alerts enabled.
ReceiveMessageOpt.notReceive1Reject incoming messages for this conversation and suppress all alerts.
ReceiveMessageOpt.notNotify2Receive messages silently without banner notifications (DND mode).

Return value

A successful Future indicates that the conversation reception option has been updated on the server. To configure account-wide notification preferences, see Set global message reception.

State changes after the call

Multi-device synchronization and arriving changes trigger conversation change events. The client updates recvMsgOpt on the local conversation model using conversationID as the merge key. For complete listener integration, see Retrieve conversation list.