Query Channels
Last updated
Last updated
The getChannels
function is a powerful function that allows you to search for and retrieve channels that match specific criteria. With this function, you can quickly and easily find the channels you need.
The function accepts several parameters that allow you to customize your search. The keyword
parameter is a string that specifies the search query, allowing you to search for channels based on their displayName
.
Once you have made your query, the function returns a of channels that match your query criteria. You can use this collection to display the search results in your app, or to further filter the results as needed.
You can query channels with the following criteria:
keyword
: Specify keyword that should be in channel displayName
includeDeleted
: Specify whether to search for channels that has been closed. Possible values are:
null
(default) - Show both channel is active and closed.
false
- Search for channels that is still open
tags
: Search for channels with the specific tags. If more than 1 tags are specified in the query, system will search for channels that contain any of those tags.
excludeTags
: Search for channels without the specific tags. If more than 1 tags are specified in the query, system will search for channels that does not contain any one of those tags.
filter
: Membership status of the user. Possible values are:
all
(default) - Search for channels
member
- Search for channels that the user is a member of
notMember
- Search for channels that the user is not a member of
flagged
- Search for channels that the user flagged
types
: type of channel to search for - conversation
, broadcast
, live
or community
userId
: Search for channels that is created by a given User ID
If you use a UITableView
or UICollectionView
to display channel list data, the ideal location to reload table data is directly in the observe block of the live collection that you are displaying.