Channel object
Channel
is an object that refers to a single chat room.
Properties
The Channel
object has the following properties:
Parameter | Type | Description |
---|---|---|
Id | FSstring | Unique identifier for the channel. Verify the channel ID with our validator. |
ChannelData | FPubnubChatChannelData | Additional data. |
→ ChannelName | FString | Display name for the channel (must not be empty or consist only of whitespace characters). |
→ Description | FString | Channel's identifier in an external system. You can use it to match id with a similar identifier from an external database. |
→ CustomDataJson | FString | JSON providing custom data about the channel. Values must be scalar only; arrays or objects are not supported. Filtering App Context data through the custom property is not recommended in SDKs. |
→ Status | FString | Tag that lets you categorize your app channels by their current state. The tag choice is entirely up to you and depends on your use case. |
→ Type | FString | Tag that lets you categorize your app channels by their functional roles. The tag choice is entirely up to you and depends on your use case. |
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()
ForwardMessage()
GetChannelData
GetChannelID
GetHistory()
GetMessage()
GetMembers()
GetPinnedMessage()
GetTyping()
GetUserRestrictions()
GetUsersRestrictions()
GetUserSuggestions()
Invite()
InviteMultiple()
IsPresent()
Join()
Leave()
PinMessage()
SendText()
SetRestrictions()
StartTyping()
StopTyping()
StreamPresence()
StreamReadReceipts()
StreamUpdates()
StreamUpdatesOn()
Update()
UnpinMessage()
WhoIsPresent()
Use case
For example, you can use the Channel
object 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.