getstream.io how to create filter for profile only

时间:2015-11-12 11:01:43

标签: java integration feeds getstream-io

I am creating a newsfeed, using stream, they allow you to apply filters, so you can get the results that you want, see below:

Feed feed = getStreamClient().newFeed("user", user);
FeedFilter filter = new FeedFilter.Builder().withLimit(size).withOffset(pageNumber).build();
List<SimpleActivity> activities = feed.newFlatActivityService(SimpleActivity.class).getActivities(filter).getResults();

This however return all the activities, which include my activities and also the users i follow, how would i filter so it only returns my activities, which where created by me

1 个答案:

答案 0 :(得分:0)

我发现您应该将用户活动存储在用户Feed中,并使用不同类型的Feed来显示来自关注用户的活动。例如。用户X喜欢某些内容,您可以向用户X的用户订阅源添加活动。用户Y跟随用户X,你让用户Y的新闻源跟随用户X的用户提要。当您在Stream上启动应用时,默认情况下会获得4种不同的Feed:用户,平面,聚合和通知。