Links

Feed & Timeline

Let your users showcase their unique personalities right in their timelines
Feed is a new way for users to create content on various areas of the SDK. Currently, users and groups can have feeds. Each feed consists of a collection of posts. Users can create posts on any groups that they are a member of and any user that they can find.
There are 3 types of feeds:
  1. 1.
    User Feed This is a collection of posts for a user's timeline.
  2. 2.
    Group Feed This is a collection of posts from members of the group or community.
  3. 3.
    Global Feed This is an aggregate of both User and Group feeds.

Query User Feed

You can get any user's feed by calling the method below with the userId:

Query Group Feed

You can get any group's feed by calling the method below with the communityId:

Query Global Feed

There are two ways to retrieve your global feed. You can either use the newFeedRepository.getGlobalFeed() method or the newFeedRepository.getCustomRankingGlobalFeed method.

Using newFeedRepository.getGlobalFeed()

If you query posts using this method, the posts will be returned in chronological order. Below is the sample code.

Using newFeedRepository.getCustomRankingGlobalFeed

Query custom post ranking is a smarter global feed that supports a score-sorting mechanism. Refer to Custom Post Ranking for more information about this feature. You can retrieve your global feed sorted by ranking score with the following method.
Fetching more posts in global feed is the same as User Feed.

Implementing feed pagination

Whether you're querying a user, group, or global feed, a maximum of 15 posts in each page will be returned. Pagination in Android uses the Paging3 library. It will automatically handle the loading of the next page when the user scrolls the list based on PagingSource logic.
Please note that PagedList functions in feed and post repository are being deprecated. They are replaced by PagingData. We may obsolete PagedList functions soon.