Key Benefit: Provide users with clear visibility into unread messages across individual channels and in aggregate, enabling efficient conversation prioritization and engagement tracking.
Feature Overview
Channel Unread Count enables tracking of unread messages at both individual channel and aggregate levels. This feature provides essential data for chat list interfaces, notification badges, and user engagement analytics.Individual Channel Tracking
Per-channel unread visibility
- Real-time unread count updates
- Channel-specific mention indicators
- Unread count support detection
- Live object synchronization
Aggregate Tracking
Cross-channel analytics
- Total unread count across all channels
- Global mention status tracking
- Cached channel aggregation
- User engagement insights
Implementation Guide
Track unread messages for specific channelsAccess unread count data directly from channel objects to display in chat lists, navigation badges, and conversation headers.
Channel Unread Properties
Property | Type | Description |
---|---|---|
unreadCount | Number | Number of unread messages in the channel |
isUnreadCountSupported | Boolean | Whether the channel supports unread count tracking |
isMentioned | Boolean | Whether the current user is mentioned in unread messages |
Code Examples
Real-time Updates: Channel unread counts are automatically updated through live objects. Subscribe to channel observations to receive instant updates when new messages arrive.
Best Practices
User Experience Design
User Experience Design
Create intuitive unread count experiences
- Use consistent badge styling across your entire application
- Implement smooth animations for count changes to avoid jarring updates
- Provide clear visual distinction between regular unread and mention notifications
- Consider accessibility requirements for users with visual impairments
Performance Considerations
Performance Considerations
Optimize unread count operations
- Use efficient data structures for tracking multiple channel states
- Implement debouncing for rapid unread count changes
- Monitor memory usage when observing many channels simultaneously
Error Handling
Error Handling
Handle unread count edge cases gracefully
- Provide fallback indicators when unread counts are unavailable
- Handle network disconnections without breaking unread tracking
- Implement retry logic for failed unread count requests
- Show appropriate loading states during unread data retrieval
Related Features
Message Receipt Sync
Real-time Sync
Set up receipt synchronization for live unread updates
Message Read Status
Read Tracking
Mark individual messages as read to update counts
Message Preview
Content Preview
Display message previews alongside unread counts
Implementation Strategy: Start with individual channel unread counts in your chat list, then add total unread aggregation for app-level indicators. Always check unread count support before implementing unread-dependent features.