Follow Following User SDK methods - GluedIn
Follow Following User SDK methods
Method Method detail
callFollowUser() Convenient setter method to follow other users.
getFollowerUsers() Convenient getter method to get list of all follower users.
getFollowingUsers() Convenient getter method to get a list of all following users.
  • Follow the user method:
    API Class : FollowUnfollow
    Method : callFollowUser
    Convenient setter method to follow other users.
    Request:
    public func callFollowUser (
    
                    userId: String,
    
                    followingId: String,
    
                    isFollow: Bool,
    
                    success: @escaping (APiResponseModel?) -> (),
    
                    failure: @escaping (String, Int) -> ()) -> ()
    
     
    
    Requested parameter:
    
    userID: LoggedIn UserId
    
    followingId: UserId, to whom loggedin user want to follow
    
    isFollow: Bool Variable to send True if user wanted to follow and False if user wanted to unfollow user
    Response:
    • Response Object : Sound Model Object
    • Keys which object have:
    • message : method response message
    • statusCode : method status code to handle further functionality
    • success : True/False
    How to call?
    FollowServices.sharedInstance.callFollowUser(
    
                userId: "userId",
    
                followingId: "followingId",
    
                isFollow: true,
    
                success: { (followObject) in
    
                    print(followObject)
    
                }) {(error, code) in
    
                    print(error)
    
                    print(code)
    
                }
  • Get Follower User list method:
    API Class : FollowUnfollow
    Method : getFollowerUsers
    Convenient getter method to get list of all follower users.
    Request:
    
    getFollowerUsers (
    
            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.getFollowerUsers(
    
                userId: "User Id",
    
                limit: 10,
    
                offset: 1) { followersList in
    
                    print(followersList?.data)
    
                } failure: { error, code in
    
                    print(error)
    
                    print(code)
    
                }
  • 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
    
                }
    
    
Start for free, pay as you grow
No credit card required.