Get Channel Invites
Retrieves a list of channel invites from the server based on the specified request parameters. This function allows users to fetch channel invites based on criteria such as channel type, page number, and page size.
Steps to get channel invites
- Create a GetChannelInvitesRequest object using the builder pattern.
- Call the
getChannelInvites()
function using an instance ofLMChatClient
, passing therequest
object and an optional response handler. - Process the response LMResponse<
GetChannelInvitesResponse
> to handle the retrieved invites or error cases.
let request = GetChannelInvitesRequest.builder()
.channelType(1)
.page(1)
.pageSize(10)
.build()
LMChatClient.shared.getChannelInvites(request: request) { response in
switch response {
case .success(let responseData):
print("Fetched \(responseData.channelInvites.count) channel invites.")
case .failure(let error):
print("Failed to get channel invites: \(error.localizedDescription)")
}
}
Models
GetChannelInvitesRequest
A request object for retrieving channel invites in the LikeMinds Chat SDK. It provides a builder pattern for constructing instances with customizable parameters.
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
channelType | Int | The type of the channel to fetch invites for | |
page | Int | The page number for paginated results (default: 1 ) | |
pageSize | Int | The number of results per page (default: 10 ) |
GetChannelInvitesResponse
The response object containing the retrieved channel invites.
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
channelInvites | ChannelInvite | A list of received channel invites |
ChannelInvite
A model representing an individual channel invite.
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
chatroom | Chatroom | The chatroom associated with the invite | |
createdAt | Int64 | Timestamp when the invite was created | |
id | Int | Unique identifier for the invite | |
inviteStatus | Int | Status of the invite | |
updatedAt | Int64 | Timestamp when the invite was last updated | |
inviteSender | Member | Member who sent the invite | |
inviteReceiver | Member | Member who received the invite |