Get Following User list method:
API Class :
FollowUnfollow
Method :
getFollowingUsers
Convenient getter method to get a list of all
following users.
Request:
getFollowingUsers (
userId: String,
limit: Int,
offset: Int,
success: @escaping (FollowersModel?) -> (),
failure: @escaping (String, Int) -> ()) -> ()
Requested parameter:
userID: LoggedIn UserId
Limit: record limit
Offset: number of page to get the record
Response:
-
Response Object :
Sound Model Object
- Keys which object have:
-
id :
content id
-
businessId :
user id
-
createdAt :
timestamp to know the creator time of the record
-
descriptionField :
decxription of the content
-
deviceId :
device id
-
deviceType :
device type
-
email :
user email
-
followersCount :
user follower count
-
followingCount :
user following count
-
fullName :
user full name
-
planType :
user plan type
-
profileImageUrl :
user profile image
-
status :
user status
-
updatedAt :
timestamp time to last update the content
-
updatedTimestamp :
timestamp time to last update the content
-
userId :
userid of the follower content
-
userName :
user name of the loggedin user
-
videoCount :
video count of the content
How to call?
FollowServices.sharedInstance.getFollowingUsers(
userId: userId,
limit: limit,
offset: pageOffset,
success: {
[weak self] followingList in
guard let weakSelf = self else { return }
guard let followingDataList = followingList?.data else { return }
weakSelf.userFollowedByMe.append(contentsOf: followingDataList)
weakSelf.didGetMyFollowingData?()
}) { [weak self] error, code in
guard let weakSelf = self else { return }
weakSelf.toastAlertMessage = error
}