The getUserFeed API enables you to query a user’s personal feed posts alongside posts they’ve authored in public communities. This provides a comprehensive view of user activity across the platform.
Platform Availability: The untilAt parameter is currently available on iOS and Android only. Web (TypeScript) support is under development.
The untilAt parameter lets you constrain the user feed to a specific time window. When provided, the SDK stops fetching and collecting posts beyond the given datetime boundary. This is useful for building “catch-up” feeds or historical profile views.
Local-only filter — untilAt is never sent to the backend.
Exclusive comparison — A post whose createdAt equals exactly untilAt is not included.
Automatic pagination stop — Once the boundary is reached, no further pages are fetched.
Real-time aware — Posts arriving via real-time events are also checked against the boundary.
Sort Direction
untilAt Acts As
Excludes Posts Where
lastCreated (newest first)
Lower bound
createdAt < untilAt
firstCreated (oldest first)
Upper bound
createdAt > untilAt
iOS
Android
Copy
Ask AI
import AmitySDKlet repository = AmityFeedRepository(client: client)// Show only posts from the last 30 dayslet thirtyDaysAgo = Calendar.current.date(byAdding: .day, value: -30, to: Date())!let collection = repository.getUserFeed( userId: "user-123", feedSources: ["user", "community"], sortBy: .lastCreated, includeDeleted: false, matchingOnlyParentPost: true, untilAt: thirtyDaysAgo)let token = collection.observe { result in switch result { case .success(let postsInfo): let posts = postsInfo.object // All posts will have createdAt >= thirtyDaysAgo print("Posts in time window: \(posts.count)") case .failure(let error): print("Error: \(error)") }}
Copy
Ask AI
import co.amity.sdk.*import java.util.Calendarval repository = AmityFeedRepository.Builder().build()// Show only posts from the last 30 daysval thirtyDaysAgo = Calendar.getInstance().apply { add(Calendar.DAY_OF_YEAR, -30)}.timerepository.getUserFeed( userId = "user-123", feedSources = listOf("user", "community"), sortBy = AmityPostQuerySortOption.LAST_CREATED, includeDeleted = false, matchingOnlyParentPost = true, untilAt = thirtyDaysAgo).subscribe { pagingData -> // All posts will have createdAt >= thirtyDaysAgo // Handle pagingData}
Public Communities Only: Only posts from public communities are included
in user feeds - Posts from private communities are never shown - Community
privacy changes affect visibility retroactively - Deleted communities remove
all associated posts from user feeds
User Profile Privacy
Privacy Settings Integration: User feed visibility respects profile
privacy - Private profiles: Only followers can see the combined feed - Public
profiles: Anyone can view community posts - Blocked users: See empty state
with filter options still visible
Community Membership
Membership Status: Posts remain visible even after leaving communities -
Left community: Posts remain if community is still public - Community becomes
private: Posts are removed from user feed - Community deleted: All posts
removed from user feed
Moderation Context
Moderator Indicators: Special badges for community moderators -
Moderator badge shown on posts in communities where user is a moderator -
Badge visibility follows community’s current state - No retroactive badge
removal when moderator status changes
Use specific feedSources instead of always querying both
Implement pagination for users with many posts
Cache frequently accessed user feeds
Dispose of live collections when no longer needed
Privacy Considerations
Always respect user privacy settings
Handle blocked users appropriately
Provide clear UI indicators for private vs public content
Follow platform privacy guidelines
User Experience
Show loading states during feed queries
Implement pull-to-refresh for real-time updates
Provide empty states for users with no content
Use skeleton screens for better perceived performance
Error Handling
Handle network connectivity issues gracefully
Implement retry mechanisms for failed queries
Provide meaningful error messages
Log errors for debugging without exposing sensitive information
Backward Compatibility: The default behavior (feedSources: ['user'])
maintains existing functionality. Enable community posts by explicitly setting
feedSources: ['user', 'community'].
Privacy Note: Community posts are only included from public communities.
Private community content is never exposed through user feeds, ensuring user
privacy and community security.
⌘I
Assistant
Responses are generated using AI and may contain mistakes.