Channel entity
Channel is an object that refers to a single chat room.
Properties
The ChannelImpl class implements the Channel protocol and takes the following properties:
extension ChannelImpl: Channel {
public var chat: ChatImpl
public var id: String
public var name: String?
public var custom: [String: JSONCodableScalar]?
public var channelDescription: String?
public var updated: String?
public var status: String?
public var type: ChannelType?
...
}
| Parameter | Description |
|---|---|
chatType: ChatImpl | Reference to the main Chat protocol. |
idType: String | Unique identifier for the channel. Verify the channel ID with our validator. |
nameType: String | Display name or title of the channel. |
customType: [String: JSONCodableScalar] | Any custom properties or metadata associated with the channel in the form of a dictionary of key-value pairs. App Context filtering language doesn’t support filtering by custom properties. |
descriptionType: String | Brief description or summary of the channel's purpose or content. |
updatedType: String | Timestamp for the last time the channel was updated or modified. |
statusType: String | Current status of the channel, like online, offline, or archived. |
typeType: ChannelType | When a channel is created, one of the available channel types is assigned (depending on the Swift Chat SDK method used for channel creation):
|
API limits
To learn about the maximum length of parameters used to set channel metadata, refer to REST API docs.
Methods
You can call the following methods on the Channel object.
Click on each method for more details.
connect()createMessageDraftdelete()deleteFile()forward()getFiles()getHistory()getMessage()getMessageReportsHistory()getMembers()getPinnedMessage()getTyping()invite()inviteMultiple()isPresent()join()leave()pinMessage()registerForPush()sendText()startTyping()stopTyping()streamPresence()streamReadReceipts()streamMessageReportsstreamUpdates()streamUpdatesOn()update()unpinMessage()unregisterFromPush()whoIsPresent()
Use case
For example, you can use the Channel-related methods to:
- Create and manage a 1:1, group, or public channel (chat).
- Invite others to join the channel.
- Configure a typing indicator to track when someone in the room is writing a message.
- Register the channel for mobile push notifications, not to miss a single message.