Ive gone through your docs and searched and have not found an answer to this. Wondering if you have a way to get how many items in a given stream have not been read by a given user?
Asked
Active
Viewed 80 times
1 Answers
1
The is_seen
and is_read
flags on activities are not set per user (see the notification feed docs). Once an activity has been marked as read/seen, it will be marked as read/seen on subsequent retrievals, regardless of user. In that sense, there is no mechanism to retrieve how many items in a given stream/feed have not been read by a specific user.
However, a common use case is to create separate notification feeds per user, e.g.
notification:billy
and notification:jimmy
and use targeting with your activities to get them on both feeds:
{
"actor": "shelly",
"verb": "like",
"object": "state:idaho",
"to": ["notification:billy", "notification:jimmy"]
}
In this way you could check how many items have not been read by billy
via the unread
field in the retrieval call for the notification:billy
feed.

Mircea Cosbuc
- 76
- 2
-
The targeting link is broken, should be [https://getstream.io/docs/targeting/?language=js](https://getstream.io/docs/targeting/?language=js) – zakum1 Jan 08 '21 at 02:07