Instant Display
Immediate feedback
- Messages appear instantly in the UI
- Optimistic rendering for smooth UX
- Real-time state tracking
- Visual delivery indicators
Robust Sync
Reliable delivery
- Automatic retry mechanisms
- Queue-based processing
- Network interruption handling
- Causal ordering maintenance
Supported Message Types
social.plus Chat supports multiple message types for diverse communication needs:Text Messages
Rich text communication
Plain and formatted text content
Image Messages
Visual sharing
Photos and visual content
File Messages
Document sharing
Files and attachments
Audio Messages
Voice communication
Audio recordings and clips
Video Messages
Video content
Short videos and clips
Custom Messages
Structured data
JSON-based custom content
Message Synchronization
Immediate message creation and displayWhen you create a message, the SDK first creates it locally and displays it immediately in the UI. This provides instant feedback while the message is being synchronized with the server in the background.
Local Message Flow
- Instant Creation: Message appears immediately in live collections
- Queue Addition: Message is added to synchronization queue
- Background Sync: Server synchronization begins automatically
- State Updates: Real-time status updates via
syncState
property
Implementation Examples
Sync State Monitoring: Use live collections to observe real-time sync state changes and provide appropriate UI feedback to users.
Error Handling & Recovery
Built-in retry mechanisms for failed messagesThe SDK automatically handles network interruptions and server errors with intelligent retry logic.
Retry Strategy
Retry Parameters- Maximum Attempts: 3 automatic retries
- Retry Interval: ~5 seconds between attempts
- Exponential Backoff: Increasing delays for subsequent retries
- Final State: Message marked as failed after max retries
Error Handling Examples
Best Practices
User Experience Optimization
User Experience Optimization
Creating smooth messaging experiencesImmediate Feedback
- Display messages instantly upon creation
- Show clear sync state indicators
- Implement smooth animations for state changes
- Provide visual feedback for all user actions
- Use skeleton screens for loading messages
- Show upload progress for media content
- Implement pull-to-refresh for message history
- Display typing indicators for active conversations
- Provide clear error messages for failed sends
- Offer retry options for failed messages
- Show network status indicators
- Implement offline mode notifications
Example: UI State Management
Performance Optimization
Performance Optimization
Efficient message handling strategiesMemory Management
- Implement proper live collection lifecycle management
- Clean up observers when views are destroyed
- Use pagination for large message histories
- Cache frequently accessed messages efficiently
- Batch message operations when possible
- Implement smart retry logic with exponential backoff
- Use compression for large message content
- Optimize image and file uploads
Error Recovery Strategies
Error Recovery Strategies
Robust error handling implementationGraceful Degradation
- Continue app functionality during network issues
- Queue messages for later sending
- Provide clear offline indicators
- Implement manual retry mechanisms
- Allow users to resend failed messages
- Enable message editing before retry
- Validate message content before sending
- Check network connectivity before operations
- Implement content filtering client-side
- Provide guidance for content policy compliance
Related Features
Message Types
Content varieties
Explore all supported message types and formats
Real-Time Updates
Live synchronization
Implement real-time message updates and notifications
Message Management
Content control
Edit, delete, and moderate message content
Implementation Strategy: Start with basic text message sending, implement proper sync state UI feedback, then add robust error handling and recovery mechanisms. Focus on user experience by providing immediate feedback and clear status indicators.