Before following other users, it is important to verify the connection status of the target user. Our SDK provides three statuses to indicate the connection status of the target user:
accept
: This status means that the target user has already connected.
pending
: This status means that the target user has received a follow request, but has not yet accepted it. This status is only available when the connection method setting is With request process.
none
: This status means that the target user has not yet connected.
blocked
: This status means that the target user has been blocked by the current user. For further information regarding blocked/unblocked users, please visit Block and Unblock User.
In addition to these statuses, our SDK also provides information about the following and follower count of the target user:
followingCount
: This is the total number of users that the target user is following.
followerCount
: This is the total number of users who are following the target user.
pendingCount
: This is the total number of follow requests that the target user has received.
By providing this information, our product allows users to manage their social connections effectively and efficiently, based on their specific needs and preferences.
The follow feature functionalities are packed in AmityUserRepository
and are able to be called via userRelationship
.
To get the current user follow information, use getMyFollowInfo
.
To get the other's user follow information, use getFollowInfo
with the userId
parameter.
To get the current user follow information, use the code below.
To get the other's user follow information, use the code below with the userId
parameter.
Version 6
Beta (v0.0.1)
To get the current user follow information, use the code below.
To get the other's user follow information, use the code below with the userId
parameter.
To retrieve of followers for a particular user, simply call the getFollowerList
method with the userId
of the user whose follower list you wish to retrieve. The method will return a collection of follow relationship objects, each of which includes information about the target user, the source, and of those two users.
The list of users following me will be arranged chronologically by the date they started following me. While there is no sorting parameter available, the default ordering is determined by the date of the follow action.
Additionally, our platform allows you to filter the follower list by follow status by passing the status
parameter. For example:
accept
filter to retrieve only the followers who you have already accepted their requests.
pending
filter to retrieve the list of users who have sent you a following request. Please note that this filter can only be applied if the configuration is With request process.
We currently do not support sorting of the follower user list.
The list of users I am following will be arranged chronologically by the date I started following them. Although no sorting parameter is applicable, the default order is based on the date of the follow action.
accept
filter to retrieve only the users whom have already accepted your follow request.
We currently do not support sorting of the following user list.
The getFollowingList
method returns of follow relationship objects, each of which includes information about the target user, the source, and the follow status of those two users. This information can be used to better understand the user's social network and manage their following more effectively.
pending
filter for retrieve the users whom you whom have not yet accepted your follow request. Please note that this filter can only be applied if the configuration is With request process.
Following relationships are a key component of social networks and are essential for creating connections between users in social features. These connections are used to determine the visibility and accessibility of data in user feeds and global feed.
Currently, our SDK provides a one-directional relationship between users. For example, when user A follows user B, the system will know that user A has connected with user B. However, user B does not necessarily have to follow user A in return.
To create relationships with other users, our SDK provides two methods:
With request process: In this method, once a user sends a "Follow" action to the target userId
, the system will send a request to the target user. The connection will not be established until the target user accepts the follow request.
Without request process: In this method, once a user sends a "Follow" action to the target userId
, the system will automatically establish the connection between the two users without requiring the target user to accept the follow request.
By providing these connection methods, our platform allows users to create and manage social connections effectively and efficiently, based on their specific needs and preferences.
The default connection method is the With request process. If you wish to change the connection method, you can contact our support team.
The SDK product provides two important methods for managing follow requests between users: accept follow request and decline follow request. These methods enable users to accept or decline requests to follow other users within the app, promoting a more personalized and engaging user experience.
To accept a follow request from another user, users can call the acceptMyFollower
method within the SDK and provide the userId
of the user whose follow request they wish to accept. This will add the user to the list of followers and allow them to receive updates within Global feed and User feed.
Version 6
Beta (v0.0.1)
Similarly, to decline a follow request from another user, users can call the declineMyFollower
method within the SDK and provide the userId
of the user whose follow request they wish to decline. This will remove the user's request to follow and prevent them from receiving updates within Global feed and User feed.
Version 6
Beta (v0.0.1)
If the Follower request is no longer available (either the follower request sender has withdrawn the request or the request has been accepted or declined before), SDK will return the error message.
To follow other users using our SDK, the process is straightforward and easy to use. Simply pass the userId
of the user you want to follow, and our SDK will handle the rest.
Once you have identified the user you wish to follow, you can use our SDK's followUser
method to initiate the follow request. The method will handle the request process, whether it requires the target user's acceptance or not, depending on the connection method setting.
To unfollow a user, simply call the unfollowUser
method with the userId
of the user you wish to unfollow. The method will handle the unfollow process, removing the connection between the two users and updating the following and follower counters accordingly.