V2TIMReceiveMessageOpt:Message Receiving Option | Feature Description |
ReceiveMsgOptEnum.V2TIM_RECEIVE_MESSAGE | Messages will be received when the user is online, and offline push notifications will be received when the user is offline. |
ReceiveMsgOptEnum.V2TIM_NOT_RECEIVE_MESSAGE | Messages will not be received no matter whether the user is online or offline. |
ReceiveMsgOptEnum.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE | Messages will be received when the user is online, and offline push notifications will not be received when the user is offline. |
V2TIMReceiveMessageOpt options can be used to implement group message notification muting:
No messages will be received.
After the message receiving option is set to V2TIM_NOT_RECEIVE_MESSAGE, no one-to-one or group messages will be received, and the conversation list will not be updated.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE.unreadCount (Details) in the V2TIMConversation of the conversation.V2TIM_RECEIVE_NOT_NOTIFY_MESSAGE based on the recvOpt (Details) in V2TIMConversation.setC2CReceiveMessageOpt API (Details) to set the message receiving option for a one-to-one chat.userIDList parameter to specify up to 30 users at a time.// Set not to receive messages no matter whether the user is online or offlineTencentImSDKPlugin.v2TIMManager.getMessageManager().setC2CReceiveMessageOpt(userIDList: ['user1','user2'], opt: ReceiveMsgOptEnum.V2TIM_NOT_RECEIVE_MESSAGE);
getC2CReceiveMessageOpt API (Details) to get the message receiving option for a one-to-one chat.V2TimValueCallback<List<V2TimReceiveMessageOptInfo>> messageOpt = await TencentImSDKPlugin.v2TIMManager.getMessageManager().getC2CReceiveMessageOpt(userIDList: ['user1','user2']);messageOpt.data.forEach((element) {// Message receiving optionelement.c2CReceiveMessageOpt;element.userID;});
setGroupReceiveMessageOpt API (Details) to set the message receiving option for a group chat.TencentImSDKPlugin.v2TIMManager.getMessageManager().setGroupReceiveMessageOpt(groupID: "groupID", opt: ReceiveMsgOptEnum.V2TIM_NOT_RECEIVE_MESSAGE);
getGroupsInfo API (Details) to get the V2TIMGroupInfo group profile object list. Here, the recvOpt field indicates the message receiving option for the group chat.V2TimValueCallback<List<V2TimGroupInfoResult>> groups = await TencentImSDKPlugin.v2TIMManager.getGroupManager().getGroupsInfo(groupIDList: ['groupID']);groups.data.forEach((element) {// Get the message receiving option of the groupelement.groupInfo.recvOpt;});
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback