Set conversation message reception
OpenIM uni-app / uni-app x SDK guide for Set conversation message reception.
recvMsgOpt controls message reception for one conversation and is updated through setConversation().
import { setConversation } from '@/uni_modules/unix-openim-sdk'
await setConversation({ conversationID, recvMsgOpt: 1 })Common values are 0 for normal reception with notifications and 2 for reception without notification. The contract also permits 1 for not receiving messages, but use it only when the product and server explicitly support that policy. Centralize these meanings in application constants instead of scattering numeric literals across pages.
This setting affects only the specified conversation. The account-level default is globalRecvMsgOpt; see Set global message reception. Effective behavior can be constrained by both levels.
Promise success, onConversationChanged, and requery are three stages. Merge the event by conversationID or query again to confirm final state instead of changing only the current page switch.
Was this page helpful?