Get Current Member
Retrieves the current community member's details. This function fetches the member object and returns a response indicating success or failure.
Steps to get the current member
- Call the
getCurrentMember()
function using the instance ofLMChatClient
. - Process the response LMResponse<GetMemberResponse> to handle the current member's details or any errors.
if let response = LMChatClient.shared.getCurrentMember() {
if let member = response.data?.member {
// Handle success
print("Current member details: \(member)")
} else {
// Handle failure
print("Failed to fetch member details.")
}
} else {
// Error occurred
print("Failed to fetch member!")
}
Models
GetMemberResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
member | Member? | The details of the current member | ✔️ |