Skip to main content
Use UserRepository to retrieve paginated live collections of a user’s followers or following. Filter by connection status (accepted or pending). Deleted users are automatically excluded and lists are ordered newest-first.

Live Collections

Auto-updates when relationships change; no manual refresh required

Status Filtering

Filter by accepted or pending; only available when request-based following is enabled

Pagination Support

Built-in pagination handled by the live collection; call nextPage() to load more

Key Features

Follower Lists

Retrieve users who are following a specific user, with status-based filtering

Following Lists

Get users that a specific user is following, including pending requests

Status-based Filtering

Filter by connection status: accepted connections or pending requests

Real-time Updates

Live collections automatically update when relationships change
Follow Relationship Object Properties:
  • sourceUser: The user who initiated the follow action
  • targetUser: The user being followed
  • status: Connection status (accepted, pending, blocked)
  • createdAt: Timestamp when the relationship was created
  • updatedAt: Timestamp of the last status change
  • Own Lists: Full access to your follower/following lists
  • Other User Lists: Access based on privacy settings
  • Pending Requests: Only visible to relevant users
  • Blocked Users: Automatically excluded from results

Get Followers List

var token: AmityNotificationToken?

// Get My Followers List
func getMyFollowerList() {
    let followers = userRelationship.getMyFollowers(with: .accepted)
    token = followers.observe { collection, changes, error in
        // Handle the result
    }
}

//Get Other User Followers List
func getFollowerList() {
    let followers = userRelationship.getFollowers(withUserId: "<user-id>")
    token = followers.observe { collection, changes, error in
        // Handle the result
    }
}

Get Following List

var token: AmityNotificationToken?

// Get My Followers List
func getMyFollowerList() {
    let followers = userRelationship.getMyFollowings(with: .accepted)
    token = followers.observe { collection, changes, error in
        // Handle the result
    }
}

//Get Other User Followers List
func getFollowerList() {
    let followers = userRelationship.getFollowings(withUserId: "<user-id>")
    token = followers.observe { collection, changes, error in
        // Handle the result
    }
}

Follow/Unfollow User

Learn how to implement basic follow and unfollow functionality

Connections & Counts

Check relationship status and connection counters between users

Accept/Decline Requests

Handle incoming follow requests with approval workflows