TIMReceiveMessageOpt:Message Receiving Option | Feature Description |
TIMReceiveMessageOpt.kTIMRecvMsgOpt_Receive | Messages will be received when the user is online, and offline push notifications will be received when the user is offline. |
TIMReceiveMessageOpt.kTIMRecvMsgOpt_Not_Receive | Messages will not be received no matter whether the user is online or offline. |
TIMReceiveMessageOpt.kTIMRecvMsgOpt_Not_Notify | Messages will be received when the user is online, and offline push notifications will not be received when the user is offline. |
TIMReceiveMessageOpt options can be used to implement group message notification muting:
No messages will be received.
After the message receiving option is set to kTIMRecvMsgOpt_Not_Receive, no one-to-one or group messages will be received, and the conversation list will not be updated.kTIMRecvMsgOpt_Not_Notify.total_unread_count (Details) in the SetConvTotalUnreadMessageCountChangedCallback callback for a change in the total unread count of a conversation.kTIMRecvMsgOpt_Not_Notify based on the conv_recv_opt (Details) in ConvInfo.MsgSetC2CReceiveMessageOpt API (Details) to set the message receiving option for a one-to-one chat.
You can use the userIDList parameter to specify up to 30 users at a time.// Set not to receive messages no matter whether the user is online or offlineTIMResult res = TencentIMSDK.MsgSetC2CReceiveMessageOpt(user_id_list, TIMReceiveMessageOpt.kTIMRecvMsgOpt_Not_Receive, (int code, string desc, string user_data)=>{// Process the async logic});
MsgGetC2CReceiveMessageOpt API (Details) to get the message receiving option for a one-to-one chat.TIMResult res = TencentIMSDK.MsgGetC2CReceiveMessageOpt(user_id_list, (int code, string desc, List<GetC2CRecvMsgOptResult> msg_opts, string user_data)=>{// Process the async logic});
MsgSetGroupReceiveMessageOpt API (Details) to set the message receiving option for a group chat.TIMResult res = TencentIMSDK.MsgSetGroupReceiveMessageOpt(group_id, TIMReceiveMessageOpt.kTIMRecvMsgOpt_Not_Receive, (int code, string desc, string user_data)=>{// Process the async logic});
Feedback