please select
  • UIKit
  • SDK
  • Server APIs
Chat/
SDK/
Unity(Game Solution)/
Message/
SDK
  • Run Demo
  • SDK Integration
  • Initialization
  • Login and Logout
  • Message
    • Message Overview
    • Sending Message
    • Receiving Message
    • Historical Message
    • Forwarding Message
    • Modifying Message
    • Deleting Message
    • Clearing Messages
    • Recalling Message
    • Online Message
    • Read Receipt
    • Querying Message
    • Group @ Message
    • Targeted Group Message
    • Notification Muting
    • Message Extension
  • Conversation
    • Conversation Overview
    • Conversation List
    • Getting Conversation
    • Conversation Unread Count
    • Pinning Conversation to the Top
    • Deleting Conversation
    • Conversation Draft
    • Conversation Mark
    • Conversation Group
  • Group
    • Group Overview
    • Group Management
    • Group Profile
    • Group Member Management
    • Group Member Profile
    • Custom Group Attribute
    • Group Counter
  • User
    • User Profile
    • User Status
    • Friend Management
    • Friend List
    • Blocklist
  • Changelog
  • Guideline for Beginners
  • Console Guide
    • Creating and Upgrading an Application
    • Basic Configuration
    • Feature Configuration
    • Account Management
    • Group Management
    • Webhook Configuration
  • Product Introduction
    • Message Management
      • One-to-One Message
      • Message Storage
      • Offline Push
      • Group Message
      • Message Formats
    • Account System
      • Login Authentication
      • Online Status Management
    • Group Related
      • Group System
      • Group Management
    • User Profile and Relationship Chain
      • Profile Management
      • Relationship Chain Management
  • Purchase Guide
    • Billing Overview
    • Pricing
  • Error Codes

Targeted Group Message

Feature Description

A targeted group message is a message sent to specified members in a group, which cannot be received by other group members.
Note:
1. To use this feature, you need to purchase the Ultimate edition.
2. The original message object used to create a targeted group message cannot be a group @ message.
3. The targeted group message feature is unavailable for communities (Community) and audio-video groups (AVChatRoom).
4. By default, targeted group messages are excluded from the unread count of a group conversation.

Sending a Targeted Group Message

A targeted group message is a message sent to specified members in a group, which cannot be received by unspecified group members. It can be implemented in the following steps: Call the MsgSendMessage API (Details) to specify the list of group members to receive the message and send the message.
Sample code:
var message = new Message
{
message_conv_id = conv_id,
message_conv_type = TIMConvType.kTIMConv_Group,
message_elem_array = new List<Elem>{new Elem
{
elem_type = TIMElemType.kTIMElem_Text,
text_elem_content = Input.text
}},
message_target_group_member_array = userid_list, // Specify the list of `UserID` values of group members to receive the message
};
StringBuilder messageId = new StringBuilder(128);
TIMResult res = TencentIMSDK.MsgSendMessage(conv_id, TIMConvType.kTIMConv_Group, message, messageId, (int code, string desc, string json_param, string user_data)=>{
// Async message sending result
});

Receiving a Targeted Group Message

By default, targeted group messages are excluded from the unread count of a group conversation. A targeted group message can be received in the same way as an ordinary message. For detailed directions, see Receiving Message.