please select
  • UIKit
  • SDK
  • Server APIs
Chat/
SDK/
Flutter/
Message/
SDK
  • Install Chat SDK
    • Install
  • Initialize Chat SDK
    • Initialize
  • Login And Logout
    • Login and Logout
  • Message
    • Message Overview
    • Sending Message
    • Receiving Message
    • Historical Message
    • Forwarding Message
    • Modifying Message
    • Message Inserting
    • 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 Group
  • Group
    • Group Overview
    • Group Management
    • Group Profile
    • Group Member Management
    • Group Member Profile
    • Custom Group Attribute
  • User
    • User Profile
    • Friend Management
    • Friend List
    • Blocklist
  • Offline Push
    • Offline Push
  • Signaling
    • Signaling Management
  • Local Search
    • Searching for Message
    • Searching for Friend
    • Searching Group
    • Searching for Group Member
  • API Reference
    • Client APIs
  • 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. This feature is supported only by the SDK for Flutter on v3.8.0 or later.
2. To use this feature, you need to purchase the Ultimate edition.
3. The original message object used to create a targeted group message cannot be a group @ message.
4. The targeted group message feature is unavailable for communities (Community) and audio-video groups (AVChatRoom).
5. 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:
1. Call the createXXXMessage API (here, XXX indicates the message type) to create an original message object V2TIMMessage.
2. Call the createTargetedGroupMessage API (Details) to create a targeted message object V2TimMessage based on the original message object and specify the list of group members to receive the message.
3. Call the sendMessage API to send the targeted message.
Sample code:
// Create a message first
V2TimValueCallback<V2TimMsgCreateInfoResult> target = await TencentImSDKPlugin.v2TIMManager.getMessageManager().createTextMessage(text: "");
// Get the ID for sending a message
String id = target.data.id;
// Create a targeted message
V2TimValueCallback<V2TimMsgCreateInfoResult> groupTarget = await TencentImSDKPlugin.v2TIMManager.getMessageManager().createTargetedGroupMessage(id: id, receiverList: ['user1','user2'],);
// Send the message
TencentImSDKPlugin.v2TIMManager.getMessageManager().sendMessage(id: groupTarget.data.id, receiver: "", groupID: "groupID");

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.