Skip to main content

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

  1. Call the getCurrentMember() function using the instance of LMChatClient.
  2. 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

VARIABLETYPEDESCRIPTIONOPTIONAL
memberMember?The details of the current member✔️