Follow / Unfollow
Following relationships are a fundamental part of social networks. This creates a relationship between users in social features. The connection between users will be used to determine the visibility and the accessibility of data in User Feed and Global feed.
User Relationship Concept
In the current state, our SDK provides a one-direction relationship. For example, when user A has followed User B, in this case, the system will know that user A has connected with B.
User Connection Method Concept
In the current state, our SDK provides two ways for users to create relationships with other users. This connection method will be applied to every user in the network.
With Request Process This means that once a user sends the Follow action to the target
userId
, the system will send the request to the target user. Until the target user accepts the follow request, the connection will not be established yet.Without Request Process This means that once a user sends the Follow action to the target
userId
, the system will automatically establish the connection between 2 users.
The default connection method is the With Request Process. If you wish to change the connection method, you can contact our support team.
Get Follow Status and Connection Counter
The first step to start following other users is to know the connection status of the target user.
Follow this sample code to get information on your follow status.
The getFollowInfo
method will call the followInfo API
.
Follow this sample code to get information on other's follow status:
The getFollowInfo
method will call the followInfo API
.
Our SDK provides 3 statuses:
ACCEPTED
This status means the target user has already connected to the SDK method caller.PENDING
This status means the target user has already received the follow request from the SDK method caller. This status will only be available when the connection method setting is With request process.NONE
This status means the target user has not connected to the SDK caller.
With the getFollowInfo
method, you can get the total count of :
followerCount
This is the total number of users that the target user is following.followingCount
This is the total number of users who followed the target user.pendingCount
This is the total number of follow requests the target user has received
Follow Other User
To start following other users, you can simply pass the userId
of the user that you want to follow and we will do the rest. Use the following code:
Withdraw Your Follow Request or Unfollow Other User
If you want to withdraw the follow request, you may use this code:
Get the List of Followers
Get your followers list, using the Followers method:
Get other's followers list by following the below method:
We currently do not support sorting of the follower user list.
Get the List of Following Users
To get the list of users whom you are following, use the Following method:
To get the list of users whom another person is following, use the Following method:
We currently do not support sorting of the following user list.
Get the List of Follow Requests
Get the list of your follow requests by using the Followers method:
We currently do not support sorting of the following user list.
Accept Follow Request
Accept a follow request by using the accept method:
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.
Decline Follow Request
Decline a follow request by using the decline method:
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.
Last updated