Getstream.io 如何在实时订阅中包含通知计数

Getstream.io how to include notification count in realtime subscription

订阅通知提要时,是否有任何方法可以从 getstream 实时订阅承诺提供的有效负载中获取未看到和未读的通知计数?如果没有,未来有没有实现的计划?

我知道我可以执行 notificationFeed.get({limit: 0}) 来检索该数据,但是,在我们当前的系统中,如果该计数随订阅负载一起提供,将会方便得多。

this.notificationFeed
    .subscribe((payload) => {
      console.log(payload)
    })
    .then(() => {
      //console.log('Full (Global Feed Flat): Connected to faye channel, waiting for realtime updates');
    }, (err) => {
      console.error('Full (Notification Feed): Could not establish faye connection', err);
    });

目前,当从通知源返回数据时,负载不包括看不见或未读的计数。

实时通知负载不包括供稿的 unseen / unread 计数。如果您监听提要的变化并想要更新计数器,您需要执行 API 调用并从那里检索计数器。