Get Notification Tray Seen
Last updated
Was this helpful?
Last updated
Was this helpful?
The getNotificationTraySeen()
method allows your app to determine whether there are unseen notifications by retrieving the current isSeen
status of the notification tray.
This is particularly useful for reflecting read/unread indicators in the UI—such as toggling a bell icon badge—based on whether new notifications have arrived since the tray was last viewed.
The seen status is managed on the server and may be affected by actions from other devices. However, the state is not updated via real-time events, and thus requires manual refresh to stay current.
🔁 Refresh Strategy
To keep the seen status accurate across clients:
1. On-demand refresh (recommended)
Invoke getNotificationTraySeen()
whenever the Notification Tray UI is refreshed.
Implement a pull-to-refresh gesture or a dedicated refresh button for user-initiated updates.
2. Polling (not recommended)
If polling is used, set the interval to 120 seconds or more to reduce the risk of server rate limiting.
Continuous polling should be avoided unless absolutely necessary.
🔄 Update Behavior
When markNotificationTraySeen()
is invoked on the same client, the isSeen
value returned by getNotificationTraySeen()
will update immediately if the LiveObject is being observed.
However, there is no cross-device real-time sync. If markNotificationTraySeen()
is invoked from another device—or if the server adds a new notification—the local client must call getNotificationTraySeen()
again to retrieve the updated state.