Skip to main content

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

  1. Create a GetChannelInvitesRequest object using the builder pattern.
  2. Call the getChannelInvites() function using an instance of LMChatClient, passing the request object and an optional response handler.
  3. 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.

VARIABLETYPEDESCRIPTIONOPTIONAL
channelTypeIntThe type of the channel to fetch invites for
pageIntThe page number for paginated results (default: 1)
pageSizeIntThe number of results per page (default: 10)

GetChannelInvitesResponse

The response object containing the retrieved channel invites.

VARIABLETYPEDESCRIPTIONOPTIONAL
channelInvitesChannelInviteA list of received channel invites

ChannelInvite

A model representing an individual channel invite.

VARIABLETYPEDESCRIPTIONOPTIONAL
chatroomChatroomThe chatroom associated with the invite
createdAtInt64Timestamp when the invite was created
idIntUnique identifier for the invite
inviteStatusIntStatus of the invite
updatedAtInt64Timestamp when the invite was last updated
inviteSenderMemberMember who sent the invite
inviteReceiverMemberMember who received the invite