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
Core Notification Types
Core Notification Types
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”
Advanced Notification Features
Advanced Notification Features
- 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
- Both global tray-level and individual item-level seen states
- Per-notification read/unread status tracking
- Flexible refresh strategies (on-demand and polling)
Developer Benefits
Developer Benefits
Easy Integration
- Simple SDK methods for quick implementation
- Minimal setup requirements with sensible defaults
- Efficient data structures and minimal API calls
- Optimized for large-scale deployments
- Consistent behavior across iOS, Android, and Web
- Shared data models and state management
Real-World Implementation Examples
Notification Scenarios
Data Models
Notification Tray Item
- Properties Overview
- Action Types
- Target Types
| Property | Type | Description |
|---|---|---|
notificationId | String | Unique identifier of notification item |
lastSeenAt | Datetime | Timestamp when the notification was last seen |
lastOccurredAt | 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 Status
Tray-Level Tracking
Tray-Level Tracking
| Property | Type | Description |
|---|---|---|
lastTraySeenAt | Datetime | Timestamp when the tray was last seen |
lastTrayOccurredAt | Datetime | Timestamp when the last tray item occurred |
isSeen | Boolean | Whether the entire tray has been seen |
Item-Level Tracking
Item-Level Tracking
| Property | Type | Description |
|---|---|---|
notificationId | String | Unique identifier of the notification |
isSeen | Boolean | Whether this specific notification has been seen |
lastSeenAt | Datetime | When this notification was marked as seen |
Troubleshooting
Common Issues
Notifications Not Appearing
Notifications Not Appearing
Possible Causes:
- Network connectivity issues
- Notification repository not properly initialized
- User permissions not granted
- Check network connectivity and API endpoints
- Verify notification repository initialization
- Ensure user has proper permissions
- Test with manual notification refresh
- Check console for error messages
Seen Status Not Updating
Seen Status Not Updating
Possible Causes:
- API call failures
- Cross-device synchronization issues
- Incorrect notification item ID handling
- Race conditions in state updates
- Verify markAsSeen API calls are succeeding
- Check for proper error handling
- Ensure notification item IDs are correct
- Implement retry logic for failed requests
- Test cross-device synchronization
Performance Issues
Performance Issues
Possible Causes:
- Loading too many notifications at once
- Inefficient UI updates
- Memory leaks from unsubscribed observers
- Implement proper pagination
- Use efficient list rendering techniques
- Dispose of observers properly
- Monitor memory usage
Related Content
Notification Tray Status
Manage overall notification tray seen status and global read tracking
Notification Items
Query, filter, and manage individual notification items with granular control
Notification Events
Complete reference for notification event types, triggers, and message templates
Realtime Events
Learn about event streams and real-time updates for notifications
User Management
Understand user interactions and social features that trigger notifications
- 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- Student asks question in course discussion
- Instructor and peers receive notifications
- Notifications include context and course information
- Quick actions for answering or viewing
Knowledge Sharing- Professional shares industry insight
- Network connections receive relevant notifications
- Notifications include professional context
- Actions for connecting or engaging
Career Development