The Follower/Following Lists feature provides comprehensive access to user relationship data through live collections. These lists enable you to build social features like follower displays, mutual connection discovery, and relationship management interfaces.

Live Collections

Real-time updated follower and following lists with automatic synchronization

Status Filtering

Filter lists by connection status: accepted, pending, or all relationships

Pagination Support

Efficient handling of large follower/following lists with built-in pagination

Key Features

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
    }
}