Create DM Chatroom
Creates a new direct message chatroom between two users. This function allows the initiation of a private conversation space for direct messaging.
Steps to create a DM chatroom
- Create a CreateDMChatroomRequest object using
CreateDMChatroomRequest.builder()
class by passing all the required parameters. - Call
createDMChatroom()
function using the instance ofLMChatClient
. - Process the response LMResponse<CheckDMChatroomResponse> as per your requirement.
let request = CreateDMChatroomRequest.builder()
.uuid("ENTER_UUID")
.memberId("ENTER_MEMBER_ID")
.build()
LMChatClient.shared.createDMChatroom(request: request) { response in
if let data = response.data {
// Process the created DM chatroom data
processCreatedDMChatroom(data)
} else if let error = response.error {
// Handle the error
handleError(error)
}
}
Models
CreateDMChatroomRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
uuid | String? | Unique identifier for the chatroom | ✔️ |
memberId | Int? | ID of the member to create the chatroom with | ✔️ |
CheckDMChatroomResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
chatroomData | Chatroom? | created chatroom data | ✔️ |