Fired when a member has joined the channel.
Parameters:
member
- member that joined the channelFired when data of a member has been updated.
Parameters:
data
- info object provided with the event. It has the following properties:member
- member that has received the updateupdateReasons
- array of reasons for updateFired when a new message has been added to the channel.
Parameters:
message
- message that has been addedFired when message is removed from the channel's message list.
Parameters:
message
- message that has been removedFired when data of a message has been updated.
Parameters:
data
- info object provided with the event. It has the following properties:message
- message that has received the updateupdateReasons
- array of reasons for updateFired when the channel was destroyed or the currently-logged-in user has left private channel.
Parameters:
channel
- channel that has been removedFired when a member has stopped typing.
Parameters:
member
- the member that has stopped typingFired when a member has started typing.
Parameters:
member
- the member that has started typingFired when the data of the message has been updated.
Parameters:
data
- info object provided with the event. It has the following properties:channel
- channel that has received the updateupdateReasons
- array of reasons for updateUnique system identifier of the channel.
Custom attributes of the channel.
Identity of the user that created this channel.
Date this channel was created on.
Date this channel was last updated on.
Name of the channel.
Signifies whether the channel is private.
Index of the last message the user has read in this channel.
Last message sent to this channel.
User notification level for this channel.
State of the channel.
Delivery status of the channel.
MemberType of the channel.
Unique name of the channel.
Add a member to the channel by its identity.
Identity of the Client to add.
Advance the channel's last consumed message index to the current read horizon. Rejects if the user is not a member of the channel. Last consumed message index is updated only if the new index value is higher than the previous.
Message index to advance to.
Resulting unread messages count in the channel.
Decline an invitation to the channel and unsubscribe from its events.
Delete the channel and unsubscribe from its events.
Get the custom attributes of this Channel.
Note: Channel.attributes will be empty for public channels until this function is called.
Get a member by its identity.
Member identity.
Get a member by its SID.
Member SID.
Get a list of all the members who are joined to this channel.
Get channel members count.
This method is semi-realtime. This means that this data will be eventually correct, but will also be possibly incorrect for a few seconds. The Programmable Chat system does not provide real time events for counter values changes.
This is useful for any UI badges, but it is not recommended to build any core application logic based on these counters being accurate in real time.
Return messages from the channel using the paginator interface.
Number of messages to return in a single chunk. Default is 30.
Index of the newest message to fetch. Default is from the end.
Query direction. By default it queries backwards
from newer to older. The "forward"
value will query in the opposite direction.
A page of messages.
Get the total message count in the channel.
This method is semi-realtime. This means that this data will be eventually correct, but will also be possibly incorrect for a few seconds. The Programmable Chat system does not provide real time events for counter values changes.
This is useful for any UI badges, but it is not recommended to build any core application logic based on these counters being accurate in real time.
Get unread messages count for the user if they are a member of this channel. Rejects if the user is not a member of the channel.
Use this method to obtain the number of unread messages together with Channel.updateLastConsumedMessageIndex instead of relying on the message indices which may have gaps. See Message.index for details.
This method is semi-realtime. This means that this data will be eventually correct, but will also be possibly incorrect for a few seconds. The Programmable Chat system does not provide real time events for counter values changes.
This is useful for any UI badges, but it is not recommended to build any core application logic based on these counters being accurate in real time.
Get user descriptors of this channel.
Invite a user to the channel by their identity.
Identity of the user.
Join the channel and subscribe to its events.
Leave the channel.
Remove a member from the channel. When a string is passed as the argument, it will assume that the string is an identity.
Identity or the member object to remove.
Send a message to the channel.
Message body for the text message,
FormData
or {@link Channel.MediaOptions) for media content. Sending FormData is supported only with the browser engine.
Attributes for the message.
Index of the new message.
Set last consumed message index of the channel to the index of the last known message.
Resulting unread messages count in the channel.
Set all messages in the channel unread.
Resulting unread messages count in the channel.
Set user notification level for this channel.
New user notification level.
Send a notification to the server indicating that this client is currently typing in this channel. Typing ended notification is sent after a while automatically, but by calling this method again you ensure that typing ended is not received.
Update the attributes of the channel.
New attributes.
Update the friendly name of the channel.
New friendly name.
Set the last consumed message index to the current read horizon.
Message index to set as last consumed. If null is provided, then the behavior is identical to Channel.setNoMessagesConsumed.
Resulting unread messages count in the channel.
Update the unique name of the channel.
New unique name for the channel. Setting unique name to null removes it.
A channel represents a remote channel of communication between multiple Programmable Chat clients.