如何在 getStream 上获取 "How many unread notifications does user have"?
How to get "How many unread notifications does user have" on getStream?
如何在 getStream 上获取 How many unread notifications does user have
?
我只需要 integer
个未读通知值。
(我会把未读通知称为主要的 Facebook
或 Instagram
!)
提前致谢
获取通知源时的典型响应是:
> notificationFeed.get().then((response) => console.log(response));
Promise { _state: 0, _onFulfilled: [], _onRejected: [] }
> { results:
[ { activities: [Array],
activity_count: 1,
actor_count: 1,
created_at: '2017-12-27T10:15:39.215550',
group: 'e325120c-eaee-11e7-97ec-1283934ff98c',
id: 'e3267b75-eaee-11e7-8080-800052f2693c.e325120c-eaee-11e7-97ec-1283934ff98c',
is_read: false,
is_seen: false,
updated_at: '2017-12-27T10:15:39.215550',
verb: 'post' } ],
next: '',
duration: '12.76ms',
unseen: 1,
unread: 1 }
响应中的 unseen
和 unread
属性分别表示通知源中标记为看不见和未读的活动数。
如何在 getStream 上获取 How many unread notifications does user have
?
我只需要 integer
个未读通知值。
(我会把未读通知称为主要的 Facebook
或 Instagram
!)
提前致谢
获取通知源时的典型响应是:
> notificationFeed.get().then((response) => console.log(response));
Promise { _state: 0, _onFulfilled: [], _onRejected: [] }
> { results:
[ { activities: [Array],
activity_count: 1,
actor_count: 1,
created_at: '2017-12-27T10:15:39.215550',
group: 'e325120c-eaee-11e7-97ec-1283934ff98c',
id: 'e3267b75-eaee-11e7-8080-800052f2693c.e325120c-eaee-11e7-97ec-1283934ff98c',
is_read: false,
is_seen: false,
updated_at: '2017-12-27T10:15:39.215550',
verb: 'post' } ],
next: '',
duration: '12.76ms',
unseen: 1,
unread: 1 }
响应中的 unseen
和 unread
属性分别表示通知源中标记为看不见和未读的活动数。