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
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
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
- Initial post notification: “New post in Photography Tips”
- Reaction notification: “5 people liked your post”
- Comment notification: “3 new comments on your post”
- Reply notification: “Someone replied to your comment”
Data Models
Notification Tray Item
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