Member State
The getMemberState
function is used to fetch the member state of the current user. It provides information about the user's status, creation timestamp, edit requirements, and more.
Steps to Get Member State
- Call
getMemberState()
function using the instance ofLMFeedClient
. - Process the response LMResponse<GetMemberStateResponse> as per your requirement.
LMFeedClient.shared.getMemberState { response in
// Response (LMResponse<GetMemberStateResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
GetMemberStateResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
createdAt | String | Timestamp of when the member state was created | ✔ |
editRequired | Bool | Indicates if edit is required | ✔ |
member | User | Details of the member | ✔ |
memberRights | MemberRight | Object of the community. | ✔ |
state | Int | Member State | ✔ |
toolState | Int | Logout response in case the user doesn't have the access. | ✔ |
Member Rights
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
id | Boolean | Whether topic is enabled or disabled. | ✔ |
isLocked | String | Input text to search topics. | ✔ |
isSelected | String | Type of search. | ✔ |
title | String | Title of Member Right | ✔ |
subtitle | String | Subtitle of Member Right | ✔ |
state | MemberRightState | State of Member Right | ✔ |
MemberRightState
public enum ManagerRightState: Int {
case unknown = -1
case moderateChatRooms = 0
case moderateMembers = 1
case editCommunityDetails = 2
case viewMemberContactInfo = 3
case addCommunityManager = 4
case moderateDMSetting = 5
case moderateFeedAndComment = 6
}