Notification Tray
Real-time Notifications
Keep users engaged with instant notifications for posts, reactions, comments, and replies
Flexible Integration
Easy-to-use SDK methods for seamless notification tray integration
Granular Control
Fine-grained read tracking with both global and per-item seen states
Cross-platform Support
Consistent notification experience across iOS, Android, and Web platforms
Architecture Overview
Key Features
The Notification Tray SDK Feature enhances user engagement and connectivity within your application by providing comprehensive notification management capabilities.Core Notification Types
Core Notification Types
User Post Notifications
Instantly notify users when someone posts within their community, keeping them updated on relevant discussions
Reaction Alerts
Users receive notifications when others react to their posts, fostering engagement and interaction
Comment Updates
Notify users when someone comments on their posts, allowing timely responses and deeper conversations
Reply Notifications
Users get alerts when someone replies to their comments, ensuring they remain engaged in ongoing discussions
State Management Features
State Management Features
- Real-time Updates: Instant notification delivery and state synchronization
- Cross-device Sync: Notification states synchronized across multiple devices
- Granular Tracking: Both global tray-level and individual item-level seen states
- Flexible Refresh: Support for both on-demand and polling refresh strategies
Developer Benefits
Developer Benefits
- Easy Integration: Simple SDK methods for quick implementation
- Customizable UI: Flexible notification display and interaction patterns
- Performance Optimized: Efficient data structures and minimal API calls
- Cross-platform: Consistent behavior across iOS, Android, and Web
Data Models
Notification Tray Item
Property | Type | Description |
---|---|---|
notificationId | String | Unique identifier of notification item |
lastSeenAt | Datetime | Timestamp when the notification was last seen |
lastOccuredAt | Datetime | Timestamp when the notification last occurred |
actors | List<AmityNotificationActors> | Data of users that acted on this notification item |
actorCount | Int | Number of users that acted on this notification item |
actionType | String | Type of action that triggered this notification |
trayItemCategory | String | Category for when action is either “mention” or “reply” |
targetId | String | Object ID of the target |
targetType | String | Type of target for this action |
referenceId | String | Optional ObjectId of the reference |
referenceType | String | Type of reference for this action |
parentId | String | Optional ObjectId of parent |
text | String | Ready to render text without any templating |
templatedText | String | Ready to render text with templating for client interpretation |
isSeen | Boolean | Whether this notification item has been seen |
isRecent | Boolean | Whether this notification item is recent or older |
users | List<AmityUser> | List of users that acted on this notification |
Notification Tray Seen State
Property | Type | Description |
---|---|---|
lastTraySeenAt | Datetime | Timestamp when the tray was last seen |
lastTrayOccuredAt | Datetime | Timestamp when the last tray item occurred |
isSeen | Boolean | Whether the entire tray has been seen |
Implementation Strategies
State Synchronization Patterns
State Synchronization Patterns
Global vs Individual Tracking
The notification system supports two levels of seen state tracking:Global Tray State
- Use
markNotificationTraySeen()
when user opens tray - Check with
getNotificationTraySeen()
for badge indicators - Ideal for UI-level read/unread indicators
Individual Item State
- Use
markSeen()
on specific tray items - Track fine-grained interaction patterns
- Perfect for detailed analytics and UX optimization
Refresh Strategy Best Practices
Refresh Strategy Best Practices
Quick Start Guide
1
Initialize Repository
Set up the notification repository in your application
2
Check Notification State
Implement badge indicators based on tray seen status
3
Mark as Seen
Update seen status when user interacts with notifications