普通网友 2017-05-26 12:02
浏览 34
已采纳

从getstream.io获取单个活动

I'm trying to fetch a single activity from getstream.io on the server following a realtime notification and enrich it.

As you can see below, it returns null until full page is fetched.

// Websockets fired. There is a new activity $id. Fetch and enrich:

// Get activity that begins with the new $id
$options = ['id_gte' => $id];

// PROBLEM: First call to get single item returns NULL
$feed->getActivities(0, 1, $options); 

// Second call without conditions returns everything fine
$feed->getActivities(0, 15); 

// The desired activity is now present in response
$feed->getActivities(0, 1, $options); 

Is there a better way to handle this or a specific time delay before id based filters are available on new messages?

  • 写回答

1条回答 默认 最新

  • douguanyan9928 2017-05-26 19:31
    关注

    thanks for pointing this out. We can certainly improve our documentation to be more clear about how we handle this scenario.

    When you use filters to fetch a feed, or non-zero offset values, Stream does not return new items on the feed.

    When you call $feed->getActivities(0, 15); that's when we would send the value as part of the feed data to later also be available with filters.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用lstm来预测股票价格
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上