please select
  • UIKit
  • SDK
  • Server APIs
Chat/
SDK/
React Native/
Message/
SDK
  • Run Demo
  • SDK Integration
  • Initialization
  • 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
  • Group
    • Overview
    • Group Management
    • Group Profile
    • Group Member Management
    • Group Member Profile
    • Custom Group Attribute
    • Community Management
  • User
    • User Profile
    • Friend Management
    • Friend List
    • Blocklist
  • Offline Push
    • Offline Push
  • Local Search
    • Searching for Message
    • Searching for Friend
    • Searching Group
    • Searching for Group Member
  • Signaling
    • Signaling Management
  • 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

Message Inserting

Feature Description

When a message is inserted, the message will only be inserted into the local database but not be sent to the server.
Caution:
Inserted messages will be lost if the account is logged in on another mobile device or the application is uninstalled and reinstalled.
This API is used to insert tips into a conversation, such as "You have left the group" and "Keep your information secure. Do not send private information such as account, password, and verification code to the group chat". Such messages need to be displayed in the chat area, but do not need to be sent to others.

Inserting a local message between one-to-one messages

Call insertC2CMessageToLocalStorage (Details) to insert a local message between one-to-one messages. Currently, the SDK for Flutter only supports inserting custom messages.
Below is the sample code:
const data = "";
const userID = "";
const sender = "";
TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.insertC2CMessageToLocalStorage(data, userID, sender);

Inserting a local message between group messages

Call insertGroupMessageToLocalStorage (Details) to insert a local message between group messages.
Below is the sample code:
const data = "";
const groupID = "";
const sender = "";
TencentImSDKPlugin.v2TIMManager
.getMessageManager()
.insertGroupMessageToLocalStorage(data, groupID, sender);