Skip to main content
SDK v7.x · Last verified March 2026 · iOS · Android · Web · Flutter
Full walkthrough below ↓
Platform note — code samples below use TypeScript. Every method has an equivalent in the iOS (Swift), Android (Kotlin), and Flutter (Dart) SDKs — see the linked SDK reference in each step.
Messages are the core of every chat experience. This guide covers the full send-read-edit-delete lifecycle, plus real-time subscriptions so your UI stays in sync without polling.
Prerequisites: Channel created and user is a member → Channels & Conversations

Limits at a Glance

Quick Start: Send and Receive Messages

Step-by-Step Implementation

1

Send a text message

Send Message
2

Query message history with pagination

Query Messages
3

Subscribe to real-time updates

The Live Collection already handles real-time updates — new messages, edits, and deletions all trigger dataUpdated. No extra setup required.Channel and message subscriptions keep documented SDK data current, but they do not expose typing-indicator state. Do not infer “typing” from user presence, a channel subscription, or message-collection activity.Real-time Events
4

Edit and delete messages

Only the message author (or a moderator) can edit or delete a message.
Edit & Delete Messages

Connect to Moderation & Analytics

social.plus AI Moderation automatically scans message text and flags violations before they’re visible to other users. Enable it in Admin Console → AI Content Moderation.AI Content Moderation
Subscribe to message.created, message.updated, and message.deleted webhook events to sync message data or trigger business logic in your backend.Webhook Events

Common Mistakes

Sending to the wrong subChannelId — For Community and Live channels, subChannelId is the same as channelId. For Conversation channels (1:1), use the channel’s defaultSubChannelId. Double-check which ID you’re using when switching channel types.
Forgetting to dispose Live Collections — Every liveCollection.on('dataUpdated', …) subscription holds an open connection. Always call liveCollection.dispose() when your component unmounts to prevent memory leaks and ghost re-renders.

Best Practices

  • Show the message instantly in the UI before the server confirms it
  • Mark it with a sending state indicator (spinner or dim text)
  • Replace with the confirmed message on success, or show a retry button on failure
  • This is the standard pattern for all major chat apps
  • Start with 20–30 messages on first load
  • Paginate backwards only when the user scrolls to the top
  • Fetching large histories upfront increases load time and memory use, especially on mobile
  • The optional tags field on messages supports full-text search
  • Tag system messages (join/leave events, announcements) so you can filter them out of the main feed
  • Useful for building filtered views like “only show media messages” or “only announcements”
Dive deeper: Messaging API Reference has full parameter tables, method signatures, and platform-specific details for every API used in this guide.

Next Steps

Reactions & Replies

Add emoji reactions and threaded replies to messages.

Rich Media Messages

Send images, audio, video, and file attachments.

Unread Counts

Surface unread badges and per-message read receipts.