SDK Reference
Methods
SetNotificationsReadTime

setNotificationsReadTime

Update the latest view timestamp for notifications.

Form of the timestamp is Unix (seconds).

How to use?

const res = await orbis.setNotificationsReadTime(options);

Parameters

  • options - object with the parameters used to retrieve notifications
    • type - string type of notifications to retrieve
      • social - mentions, likes, replies, etc
      • messages - unread messages
    • context - string The context for which you want to view notifications
    • timestamp - int Should be set to the current timestamp. Unix timestamp is required (seconds)

Returns

{
  status: 200,
  doc: 'k...',
  result: 'Success creating TileDocument.'
}

Examples

Update notification read time

/** Get the current timestamp */
const currentTimestamp = Date.now()
 
/** Convert the timestamp to seconds as Javascript uses miliseconds */
const unixTimestamp = Math.floor(currentTimestamp / 1000)
 
const res = await orbis.setNotificationsReadTime({
    type: "social",
    timestamp: unixTimestamp
});