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 description: String?
public var updated: String?
public var status: String?
public var type: ChannelType?
...
}
Parameter | Type | Description |
---|---|---|
chat | ChatImpl | Reference to the main Chat protocol. |
id | String | Unique identifier for the channel. Verify the channel ID with our validator. |
name | String | Display name or title of the channel. |
custom | [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. |
description | String | Brief description or summary of the channel's purpose or content. |
updated | String | Timestamp for the last time the channel was updated or modified. |
status | String | Current status of the channel, like online , offline , or archived . |
type | 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()
delete()
deleteFile()
forward()
getFiles()
getHistory()
getMessage()
getMessageReportsHistory()
getMembers()
getPinnedMessage()
getTyping()
invite()
inviteMultiple()
isPresent()
join()
leave()
pinMessage()
registerForPush()
sendText()
startTyping()
stopTyping()
streamPresence()
streamReadReceipts()
streamMessageReports
streamUpdates()
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.