Block and UnBlock user SDK methods
-
Get Blocked user list which block logged in user:
API Class :
BlockUser
Method :
getUserListBlockedByMe
Convenient getter method to get Blocked user list which is blocked by logged in user.
Request:
failure: @escaping (String) -> ()) -> ()
Requested parameter. : Nil
Profile.sharedInstance.getUserListBlockedByMe { [weak self] result in
guard let weakSelf = self else { return }
print(result)
} failure: { [weak self] error in
guard let weakSelf = self else { return }
print( error)
}
Response:
-
Response Object :
Blocked user model
-
Success :
“True/False”
-
id :
string value to use further
-
descriptionField :
description field to pass the message with block
-
email :
email which logged in user blocked
-
fullName :
User full name
-
profileImageUrl :
User profile image which logged in user blocked
-
status :
Status
-
userId :
Blocked user userId
-
userName :
Blocked user username
-
Block and unblock user by logged in user:
API Class :
BlockUser
Method :
blockUnblockUser
Convenient setter method to set block/unblock users.
Request:
Requested parameter.
userId : pass selected UserId so the system could know that which user, logged in user wanted to block. Mandatory field. isblocked: Bool → True to send block, False to send unblock
BlockUser.sharedInstance.blockUnblockUser(userId: "userId",isblocked: true) {result in
//weakSelf.isBlockUser = isBlockUser
print( result)
} failure: {error in
print( error)
}
Response:
-
Response Object :
Block User Response Object
-
Keys which object have:
-
Status code:
“Status code to know response status from API”
-
Message:
Block message”
-
email :
email which logged in user blocked
-
Success:
“True/False”
-
Block and unblock user by logged in user:
API Class :
BlockUser
Method :
getUserListWhoBlockedMe
Convenient getter method which will provide user list which is blocked by me.
Request:
Requested parameter. : Nil
Profile.sharedInstance.getUserListWhoBlockedMe(userId: "User ID", isblocked: true) {result in
print( result)
} failure: {error in
print( error)
}
Response:
-
Response Object :
Blocked user model
-
Keys which object have:
-
Id:
“string value to use further”
-
descriptionField :
"description field to pass the message with block”
-
email :
“email which logged in user blocked”
-
fullName :
“User full name”
-
profileImageUrl :
“User profile image which logged in user blocked”
-
status:
“Status”
-
userId:
“Blocked user userId”
-
userName :
“Blocked user username”