Real-Time Messaging Foundation: social.plus Chat provides a robust messaging system with support for various content types, real-time synchronization, and advanced features like reactions, threading, and moderation. Build engaging chat experiences with flexible message handling and rich content support.
Messaging Overview
social.plus Chat messaging system enables real-time communication through JSON-based message containers that support diverse content types and advanced interaction features.Message Types
Flexible content support
- Text messages with rich formatting
- Image messages with metadata
- File attachments and documents
- Custom JSON message types
Real-Time Features
Live communication
- Real-time message synchronization
- Live typing indicators
- Message reactions and interactions
- Thread and reply support
Message Architecture
Understanding message fundamentalsMessages are JSON content containers that can contain up to 20,000 characters or weigh up to 100KB for custom messages. They are synchronized among all channel users in real-time, providing instant communication across all connected clients.
Message Capacity
Content Type | Limit | Recommendation |
---|---|---|
Text Content | 20,000 characters | Optimal for rich text and formatted content |
Custom JSON | 100KB total size | Ideal for structured data and metadata |
Binary Data | External storage | Use cloud storage URLs for large files |
Storage Strategy
For messages requiring larger binary data (such as files, high-resolution images, or documents), we recommend uploading the data to cloud storage services like AWS S3, Google Cloud Storage, or Azure Blob Storage, then storing the URL reference in the message data.Cross-Platform Compatibility: The message payload structure remains consistent across all development platforms (iOS, Android, Web, Flutter), ensuring seamless communication regardless of client type.
Message Data Structure
Core Message Properties
Property | Type | Description | Notes |
---|---|---|---|
messageId | String | Unique identifier for the message | Auto-generated, immutable |
channelId | String | Channel where the message was created | Links message to conversation |
userId | String | ID of the user who created the message | Message author identification |
type | String | Message type identifier | text , image , file , custom |
data | Object | Message content and metadata | Type-specific structure |
Relationship Properties
Property | Type | Description | Use Case |
---|---|---|---|
parentId | String | Parent message ID for replies | Threading and conversation organization |
childrenNumber | Integer | Count of reply messages | Thread management and UI indicators |
Content Management
Property | Type | Description | Behavior |
---|---|---|---|
tags | Array<String> | Message categorization labels | Filtering and organization |
isDeleted | Boolean | Soft deletion status | Preserves structure while hiding content |
Timestamps
Property | Type | Description | Use Case |
---|---|---|---|
createdAt | Date | Message creation timestamp | Chronological ordering |
updatedAt | Date | Last modification timestamp | Change tracking |
editedAt | Date | Last edit timestamp | Edit history and indicators |
Engagement Metrics
Property | Type | Description | Structure |
---|---|---|---|
reactions | Object | Reaction data with counts | { "like": 5, "heart": 2 } |
reactionsCount | Integer | Total reaction count | Sum of all reaction types |
myReactions | Array<String> | Current user’s reactions | ["like", "heart"] |
flagCount | Integer | Number of user flags | Moderation metric |
Implementation Patterns
Message Creation Workflow
Message Creation Workflow
Implementing comprehensive message creationBasic Text Messages
- Validate user permissions and channel access
- Prepare message data with required fields
- Send message through appropriate SDK method
- Handle real-time updates and acknowledgments
- Upload binary content to external storage (if applicable)
- Generate content URLs and metadata
- Create message with structured data payload
- Implement progress indicators for uploads
- Implement draft saving for longer messages
- Validate content before sending
- Handle network failures gracefully
- Provide sending status feedback
Real-Time Synchronization
Real-Time Synchronization
Managing live message updatesLive Collections Implementation
- Subscribe to message collections for real-time updates
- Handle message additions, modifications, and deletions
- Implement efficient UI updates with minimal re-rendering
- Manage memory usage with proper collection lifecycle
- Handle concurrent message edits gracefully
- Implement optimistic UI updates with rollback capability
- Manage offline message queuing and synchronization
- Provide clear feedback for failed operations
- Implement message pagination for large conversations
- Use efficient data structures for message storage
- Optimize network usage with smart caching
- Handle large channel member counts efficiently
Content Management
Content Management
Organizing and moderating message contentThreading and Organization
- Implement intuitive reply and thread interfaces
- Manage nested conversation depth appropriately
- Provide clear thread navigation and context
- Handle thread collapse and expansion efficiently
- Implement user flagging with clear reporting options
- Design admin interfaces for content review
- Handle message deletion with appropriate user feedback
- Maintain audit trails for moderation actions
- Implement client-side content validation
- Handle server-side filtering responses
- Provide user education on content policies
- Design appeals and review processes
User Experience Design
User Experience Design
Creating engaging messaging interfacesMessage Display
- Design clear message bubbles with proper spacing
- Implement read receipts and delivery indicators
- Show typing indicators and user presence
- Handle message states (sending, sent, delivered, read)
- Implement intuitive reaction interfaces
- Design clear edit and delete controls
- Provide smooth animation for message updates
- Handle long-press and gesture interactions
- Implement proper screen reader support
- Provide keyboard navigation for all features
- Use appropriate color contrast and sizing
- Support voice control and alternative input methods
Key Features
Message Creation
Content composition
Send text, images, files, and custom content types
Message Management
Content control
Edit, delete, and moderate message content
Reactions
User engagement
Implement emoji reactions and custom interactions
Real-Time Updates
Live communication
Handle real-time message synchronization and updates
Getting Started
1
Basic Message Sending
Start with simple text message implementation using the Chat SDK’s text message APIs
2
Add Rich Content
Integrate image and file sharing capabilities with external storage solutions
3
Implement Interactions
Add reactions, editing, and threading features for enhanced user engagement
4
Enable Real-Time
Implement live collections and real-time synchronization for dynamic conversations
5
Add Moderation
Integrate content moderation, flagging, and administrative controls
Development Strategy: Begin with basic text messaging, then progressively add rich content support, interactive features, and moderation capabilities. Focus on real-time synchronization early to ensure smooth user experiences across all connected clients.