Method | Method detail |
---|---|
getFeedByUserId() | Convenient getter to get feed list record by userid. |
getUserDetails() | Convenient getter method to get profile information based on passed userid as parameter. |
updateUserProfile() | Convenient setter method to edit profile information based on passed parameter and get updated user information. |
updateProfileImage() | Convenient setter method to edit profile Image. |
checkUserNameAvailability() | Convenient getter method to check if user name is available in the system or not. Password. |
followUnFollowUser() | Convenient setter method to add user in the following/Follower user list. |
getFollowerList() | Convenient getter method to get follower user list record set. |
isUserLogedin() | Convenient getter method to get user login status. |
Requested parameter.
userId: Pass the userId by which you wanted to get all feed data
limit: pass the record limit which you wanted to generate your UI. Type: Int
offSet: pass the paging offset value. Type: Int
// Call feed API based on userId
Profile.sharedInstance.getFeedByUserId(userId:"User ID", limit: 10, offset: 1) {(videoObject) in
print(videoObject)
print(videoObject.total)
//videoObject.description
//videoObject.total
//videoObject.page
//videoObject.perPage
} failure: { (error, code) in
//Action for fail
print(error)
print(code)
}
Requested parameter.
userID: user id which you wanted to get the profile information.
Profile.sharedInstance.getUserDetails( "964583e3-a2d7-4086-bcf7-7bae3c9cdc78",
success:{ userData in
print(userData.data) //Content metadata to use in further to get the user information
}, failure: {error,arg in
print(error)
print(arg)
// Action for Fail
})
Requested parameter.
profileImageUrl: user profile image url information to pass and update.
fullName: full name information which you wanted to update
userName: userName information which will use to update
email: email account information which will use to identify the person
Description: any update remark (Optional)
// Call to update user information
Profile.sharedInstance.updateUserProfile(
profileImageUrl: "User profile image url",
fullName: "Full Name",
userName: "User username",
description: "Description if any") { UserModel in
print(UserModel)
print(UserModel.data)
} failure: { error, code in
print(error)
print(code)
}
Requested parameter.
base64Image: user profile image to pass and update.
Profile.sharedInstance.updateProfileImage(base64Image: "base64String") {(userEditImageObject) in
print(userEditImageObject)
print(userEditImageObject.data ?? "")
} failure: {(error, code) in
print("error : ",error)
print("code : ",code)
}
Requested parameter.
userName: user name which you wanted to check if this is valid or not.
// Call to update user userName information
Profile.sharedInstance.checkUserNameAvailability(userName: "New userName") {
(checkUser) in
if (checkUser?.success == true) {
// Do something
} else {
// Do something
}
} failure: { (error) in
print(error)
// Do something
}
Requested parameter.
userId: Loggedin user id.
followingId: UserId which you wanted to follow
isFollow: Status to follow or unfollow
// Call to update user userName information
Profile.sharedInstance.followUnFollowUser(
userId: userId,
followingId: followingId,
isFollow: isFollow
) { [weak self] followObject in
guard let weakSelf = self else { return }
weakSelf.followUserIndex = index
} failure: { [weak self] error, code in
guard let weakSelf = self else { return }
weakSelf.showAlertClosureWithError?(error, code)
}
Requested parameter.
userId: Loggedin user id.
lmit: limit to pass the response data limit
offset: Page number for the data
// Call to update user userName information
Profile.sharedInstance.getFollowerList(
userId: userId,
limit: limit,
offset: pageOffset
) { [weak self] result in
guard let weakSelf = self else { return }
//weakSelf.didGetFollowersData?()
} failure: { [weak self] error, code in
guard let weakSelf = self else { return }
//weakSelf.showToastAlertClosure?(error, code)
}
Requested parameter.
userId: Loggedin user id.
lmit: limit to pass the response data limit
offset: Page number for the data
// Call to update user userName information
Profile.sharedInstance.getFollowingList(
userId: userId,
limit: limit,
offset: pageOffset
) { [weak self] result in
guard let weakSelf = self else { return }
weakSelf.isLoading = false
guard let followingDataList = result?.result else { return }
weakSelf.userFollowedByMe.append(contentsOf: followingDataList)
weakSelf.didGetMyFollowingData?()
} failure: { [weak self] error, code in
guard let weakSelf = self else { return }
weakSelf.isLoading = false
weakSelf.showToastAlertClosure?(error, code)
}