Comment on page
The notification tray service is designed to automatically create and group notification records in a notification tray separated by user. The main function of this service is to provide the notification history for each user.
Here's an example of a simple notification tray that we have customized with this service. As shown in the picture, the Notification Tray contains a history of notifications displayed as rows of notification records. Each notification record contains details about a particular notification, including a list of the actors who performed the action, the action performed (verb) and the target of the action (target).
- A notification record consists of actors, a verb and a target - for example:
- John Doe and 3 others commented on Sarah Janes's Post
- Actors: John Doe and 3 other users
- Verb: comment
- Target: Sarah Jane's Post
- Notification Tray automatically groups events with the same verb and target together and aggregate list of actors into the same Notification Record.
- By default, the notification tray displays up to 10 notification records per page, sorted from newest to oldest, using the date of the last update as a reference. All notification records are stored for 90 days from the last update.
- Each notification record displays up to 3 actor names, sorted by the date of record activity, except for mentions. They won't be grouped but shown individually.
- ImageUrl of a notification record is the profile image of the latest actor who acts on the target.
- The notification record expires 90 days after the timestamp of the
lastUpdateand is then deleted from Notification Tray after expiring.
- When a user leaves a community, the user's notification records are not updated with the target associated with the community. When the user rejoins a community, the notification records are updated again, but events that happen during the time the user left the community are not retroactively reflected in the record.
The following table shows supported scenarios and Tray Message that is recorded into Notification Record
The notification tray supports 2 reading levels as follows:
- 1.Last Read: Update the last read timestamp of the user. This is used to update the total unread count of notification records.
- 2.Has Read: Flag on each individual notification record that shows whether the user has explicitly read or click the notification record. This is represented as
hasReadvalue inside each notification record JSON and can be used to display 'unread dot' on each notification record on Notification Tray.
Get the total unread count of notifications in the user's notification tray.
Retrieve notification records of a user
Update lastRead timestamp of the user
Mark a notification record as read
- When a user changes their display name, the actor's name in Tray Message is not updated.
- Notification Tray currently does not support
- Post on user feed
- Grouping mention into one record
- Customization of
descriptionis not supported. If customization / localization of notification records is needed we recommend constructing the message at the frontend as notification records already contain all the information needed.
Don't worry, Version 2 can still be used, but it won't support the mention feature. So, we highly recommend migrating to v3, and here is the list of changes needed to use Version 3!
Last modified 3mo ago