Skip to main content
Use UserRepository to check the current relationship status between two users (following, pending, none, or blocked) and retrieve follower, following, and pending request counts.

Connection Status

Returns one of four statuses: following, pending, none, or blocked

Connection Counters

Returns follower count, following count, and pending request count for any user

Connection Status Types

Available Connection Statuses:
StatusDescriptionUser Action Available
followingActive connection establishedCan unfollow
pendingFollow request sent, awaiting approvalCan withdraw request
noneNo relationship existsCan send follow request
blockedUser has been blockedCan unblock user
Status Transitions: Connection Counters Explained:

Following Count

Total number of users that the target user is following

Follower Count

Total number of users who are following the target user

Pending Count

Total number of follow requests the target user has received but not yet processed

Get User Follow Information

let userRepository = AmityUserRepository(client: client)
let userRelationship = userRepository.userRelationship

// To get the current user to follow information, use getMyFollowInfo.
token = userRelationship.getMyFollowInfo().observe({ liveObject, error in
    // Handle result
})

// To get the other's user follow information, use getFollowInfo with the userId parameter.
token = userRelationship.getFollowInfo(withUserId: "user-id").observe({ liveObject, error in
    // Handle result
})

Follow/Unfollow User

Learn how to implement basic follow and unfollow functionality

Accept/Decline Requests

Handle incoming follow requests with approval workflows

Follower Lists

Retrieve and display follower and following lists for users