Feed & Timeline
Let your users showcase their unique personality right in their timelines
Feed is a great way for users to get relevant updates, communicate and express themselves via algorithmically ranked content.
Each feed consists of a collection of posts. Users will be able to create posts on any groups that they are a member of and any user that they can find.
There is also a global feed which is an aggregate of all the posts in a user's feed.
Feed management methods are all contained in EkoFeedRepository
class.
Query User Feed
Querying for feed fetches your posts in your own feed or other user's feed. You can also sort the posts by lastCreated
or firstCreated
timestamp. EkoUserFeedSortOption
enum provides both sort options which you can provide as argument while fetching feed.
EkoFeedRepository
class exposes two convenient methods getMyFeedSortedBy(_:)
and getUserFeed(_:)
to query for your own feed and other user's feed respectively. getUserFeed(_:)
method requires an additional parameter userId
.
There is a quick easy method to get your own feed:
Live Collection for feed provides max 20 posts per each page. You can easily fetch more posts by using nextPage()
method from the same live collection.
Query Group Feed
You can get any group's feed by calling the method below with the communityId
. Fetching more posts for Group Feed is same as User Feed.
Query Global Feed
You can retrieve your global feed by calling the following method.
Fetching more posts in global feed is same as User Feed.
Last updated