Skip to main content
The Notification Tray SDK Feature enhances user engagement and connectivity within your application by providing comprehensive notification management capabilities. This feature allows users to receive notifications based on interactions from others, ensuring they stay informed and connected to their community. Designed for seamless integration, the Notification Tray SDK ensures real-time updates, improved user retention, and a more engaging social experience.

Key Features

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

Notification Types & Use Cases

User Post Notifications

Trigger: When someone posts within a communityPurpose: Keep users updated on relevant discussions and new contentExample: “John shared a new post in Photography Community”

Reaction Alerts

Trigger: When others react to user’s postsPurpose: Foster engagement and interaction through feedbackExample: “Sarah and 3 others liked your post”

Comment Updates

Trigger: When someone comments on user’s postsPurpose: Enable timely responses and deeper conversationsExample: “Mike commented on your post: ‘Great insights!’”

Reply Notifications

Trigger: When someone replies to user’s commentsPurpose: Ensure users remain engaged in ongoing discussionsExample: “Anna replied to your comment in Tech Discussion”
  • State Management
  • Customization Options
Cross-device Sync
  • Notification states synchronized across multiple devices
  • Seen status propagated instantly across all user sessions
  • Consistent notification counts and states
Granular Tracking
  • Both global tray-level and individual item-level seen states
  • Per-notification read/unread status tracking
  • Flexible refresh strategies (on-demand and polling)
Easy Integration
  • Simple SDK methods for quick implementation
  • Minimal setup requirements with sensible defaults
Performance Optimized
  • Efficient data structures and minimal API calls
  • Optimized for large-scale deployments
Cross-platform Consistency
  • Consistent behavior across iOS, Android, and Web
  • Shared data models and state management

Real-World Implementation Examples

Notification Scenarios

  • Social Media App
  • Educational Platform
  • Professional Network
Community Post Scenario
  • User posts in “Photography Tips” community
  • All community members receive notifications
  • Notification includes post preview and author info
  • Users can react directly from notification
Engagement Chain
  1. Initial post notification: “New post in Photography Tips”
  2. Reaction notification: “5 people liked your post”
  3. Comment notification: “3 new comments on your post”
  4. Reply notification: “Someone replied to your comment”

Data Models

Notification Tray Item

  • Properties Overview
  • Action Types
  • Target Types
PropertyTypeDescription
notificationIdStringUnique identifier of notification item
lastSeenAtDatetimeTimestamp when the notification was last seen
lastOccurredAtDatetimeTimestamp when the notification last occurred
actorsList<AmityNotificationActors>Data of users that acted on this notification item
actorCountIntNumber of users that acted on this notification item
actionTypeStringType of action that triggered this notification
trayItemCategoryStringCategory for when action is either “mention” or “reply”
targetIdStringObject ID of the target
targetTypeStringType of target for this action
referenceIdStringOptional ObjectId of the reference
referenceTypeStringType of reference for this action
parentIdStringOptional ObjectId of parent
textStringReady to render text without any templating
templatedTextStringReady to render text with templating for client interpretation
isSeenBooleanWhether this notification item has been seen
isRecentBooleanWhether this notification item is recent or older
usersList<AmityUser>List of users that acted on this notification

Notification Tray Seen Status

PropertyTypeDescription
lastTraySeenAtDatetimeTimestamp when the tray was last seen
lastTrayOccurredAtDatetimeTimestamp when the last tray item occurred
isSeenBooleanWhether the entire tray has been seen
Usage: Track when user last viewed the notification tray to show unread count badges
PropertyTypeDescription
notificationIdStringUnique identifier of the notification
isSeenBooleanWhether this specific notification has been seen
lastSeenAtDatetimeWhen this notification was marked as seen
Usage: Track individual notification read status for granular control

Troubleshooting

Common Issues

Possible Causes:
  • Network connectivity issues
  • Notification repository not properly initialized
  • User permissions not granted
Solutions:
  1. Check network connectivity and API endpoints
  2. Verify notification repository initialization
  3. Ensure user has proper permissions
  4. Test with manual notification refresh
  5. Check console for error messages
Possible Causes:
  • API call failures
  • Cross-device synchronization issues
  • Incorrect notification item ID handling
  • Race conditions in state updates
Solutions:
  1. Verify markAsSeen API calls are succeeding
  2. Check for proper error handling
  3. Ensure notification item IDs are correct
  4. Implement retry logic for failed requests
  5. Test cross-device synchronization
Possible Causes:
  • Loading too many notifications at once
  • Inefficient UI updates
  • Memory leaks from unsubscribed observers
Solutions:
  1. Implement proper pagination
  2. Use efficient list rendering techniques
  3. Dispose of observers properly
  4. Monitor memory usage