SDKsFlutter
Set conversation message receive option
Configure message reception and do-not-disturb preferences for an individual conversation using the OpenIM Flutter SDK.
Configure notification reception and do-not-disturb (DND) behavior for a specified conversation:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | String | Yes | Target conversation ID. |
req | ConversationReq | Yes | Conversation modification request. Pass the desired option in recvMsgOpt. |
Code example
await OpenIM.iMManager.conversationManager.setConversation(
conversationID,
ConversationReq(recvMsgOpt: ReceiveMessageOpt.notNotify),
);ReceiveMessageOpt enum values:
| Enum Option | Value | Behavior |
|---|---|---|
ReceiveMessageOpt.receive | 0 | Receive messages normally with system notification alerts enabled. |
ReceiveMessageOpt.notReceive | 1 | Reject incoming messages for this conversation and suppress all alerts. |
ReceiveMessageOpt.notNotify | 2 | Receive 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.
Was this page helpful?