Channel Retrieval Methods
social.plus Chat SDK offers two methods for retrieving channel information, giving you flexibility based on your specific needs:Single Channel Retrieval
Get specific channel by ID
- Returns Live Object with real-time updates
- Complete channel information and metadata
- Ideal for channel details and validation
Multiple Channel Query
Query up to 100 channels simultaneously
- Batch retrieval with Live Collection
- Automatic filtering of invalid channels
- Efficient for bulk channel operations
Get a Single Channel
Retrieve detailed channel information The function allows users to retrieve information about a specific channel using thechannelId
parameter. This function returns a Live Object of the AmityChannel
class, which contains information such as the channel’s display name, tags, avatar, and other metadata.
This function is useful for a variety of purposes, such as displaying information about a channel to users or retrieving channel details before joining the channel.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
channelId | String | ✅ | Unique identifier of the channel to retrieve |
Code Examples
Get Multiple Channels
Query multiple channels by ID SDK now supports querying channels based on provided channel IDs. TheChannelRepository
class includes a getChannels
method that takes an array of channel IDs as input and returns a live collection of channels. This live collection will contain all the channels that are being queried in the first page. This live collection will not support pagination.
Any update to the channels present in this live collection will be automatically notified to the user. Furthermore:
- This live collection will only contain valid channels. In case of invalid channels (such as user gets banned etc.) the list may exclude those channels.
- If any channel id is invalid, live collection will throw error.
The maximum number of channels that can be queried is 100.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
channelIds | Array<String> | ✅ | Array of channel IDs to retrieve (max 100) |
Code Examples
Limitations
Collection Persistence: If the channel is not public and user leaves the channel, the channel will still remain in the live collection until user refresh or resets the live collection.
Next Steps
Create Channels
Set up new channels with custom configurations
Update Channels
Modify channel properties and settings
Query Channels
Search and filter channels with advanced criteria
Development Tip: Use single channel retrieval for displaying specific channel details and batch retrieval when you need to load multiple channels efficiently. Live Objects provide automatic updates for real-time synchronization.