Skip to main content
Use channel queries to build inboxes, public channel discovery, event chat lists, and moderation views. Query support is similar across platforms, but not identical: TypeScript and Flutter expose keyword/display-name style searching, while Android’s public channel query builder focuses on type, membership, tags, and deleted-state filters.

Filter Surface

Parameters

Query A Channel List

Query channels with type, membership, tag, deletion, archive, search, and pagination options where each platform exposes them.

Sort A Channel List

Use sortBy to choose how a channel list is ordered. Choose lastMessage for an inbox that should follow the conversation, so that joining or leaving a channel does not push it to the top. Each platform names the values in its own style:
  • Live order. The collection reorders as messages arrive. When the current user sends a message, that channel moves to the top right away, before the server responds.
  • lastMessageAt. The channel’s lastMessageAt is the time of its newest message, or its creation time if it has none. Unlike lastActivity, membership changes and closing the channel do not change it. It is null (nil on iOS) when the backend has no value for the channel yet, and those channels are listed last, ordered by creation time. Read it as channel.getLastMessageAt() on Android, channel.lastMessageAt on iOS, and channel.lastMessageAt on TypeScript.
  • Backend support. lastMessage needs backend support for your network. Until it is available, the query fails with HTTP status 422 and error code 500000. The SDK does not retry and does not fall back to lastActivity, so handle the error in your query callback. On iOS, error.isAmityErrorCode(.business) identifies it, and on TypeScript the code is Amity.ServerError.BUSINESS_ERROR. On Android, the error arrives as LoadState.Error in the paging load state, not in the subscribe error callback. AmityError.from(error) == AmityError.BUSINESS_ERROR identifies it.
Flutter’s sortBy currently accepts LAST_ACTIVITY only. On TypeScript, sortBy also accepts lastCreated, firstCreated, and displayName.

Query A Specific Type

Use the type-specific helpers when the platform exposes them. Some helpers apply membership defaults: for example, Flutter’s conversationType() and liveType() also set the filter to MEMBER. Use type-specific channel queries when your UI needs a focused list such as conversations or live channels.

Known IDs

If you already have channel IDs, use Get Channels instead of a filtered query. Batch get-by-IDs is currently exposed on TypeScript, iOS, and Android.

Create Channels

Create a channel before it appears in query results.

Get Channels

Retrieve a single channel or a known list of IDs.

Archive Channels

Hide or restore archived conversation channels where supported.

Query Members

Query members after selecting a channel.