Query Channels

Query Channels

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 displayName parameter is a string that specifies the search query, allowing you to search for channels based on their public display name.

Once you have made your query, the function returns a Live Collection 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:

  • displayName: The public display name of the channel.

  • includeDeleted : Specify whether to search for channels that have been closed. Possible values are:

    • null (default) - Show both channels are active and closed.

    • false - Search for channels that are still open

  • tags : Search for channels with specific tags. If more than 1 tags are specified in the query, the 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, the system will search for channels that do 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 are created by a given User ID (only if you're an admin).

If you use a UITableView or UICollectionView to display channel list data, the ideal location to reload table data is directly in the observed block of the live collection that you are displaying.

Last updated