Indicates whether the presence set synchronization between Ably and the clients on the channel has been completed. Set to true
when the sync is complete.
Enters the presence set for the channel, optionally passing a data
payload. A clientId
is required to be present on a channel.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
Optional
data: any
The payload associated with the presence member.
Enters the presence set of the channel for a given clientId
. Enables a single client to update presence on behalf of any number of clients using a single connection. The library must have been instantiated with an API key or a token bound to a wildcard clientId
.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
The ID of the client to enter into the presence set.
Optional
data: any
The payload associated with the presence member.
Retrieves the current members present on the channel and the metadata for each member, such as their PresenceAction and ID. Returns an array of PresenceMessage objects.
A promise which, upon success, will be fulfilled with an array of PresenceMessage objects. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.
Optional
params: RealtimePresenceParams
A set of parameters which are used to specify which presence members should be retrieved.
Retrieves a PaginatedResult object, containing an array of historical PresenceMessage objects for the channel. If the channel is configured to persist messages, then presence messages can be retrieved from history for up to 72 hours in the past. If not, presence messages can only be retrieved from history for up to two minutes in the past.
A promise which, upon success, will be fulfilled with a PaginatedResult object containing an array of PresenceMessage objects. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.
Optional
params: RealtimeHistoryParams
A set of parameters which are used to specify which presence messages should be retrieved.
Leaves the presence set for the channel. A client must have previously entered the presence set before they can leave it.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
Optional
data: any
The payload associated with the presence member.
Leaves the presence set of the channel for a given clientId
. Enables a single client to update presence on behalf of any number of clients using a single connection. The library must have been instantiated with an API key or a token bound to a wildcard clientId
.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
The ID of the client to leave the presence set for.
Optional
data: any
The payload associated with the presence member.
Registers a listener that is called each time a PresenceMessage matching a given PresenceAction, or an action within an array of PresenceAction
s, is received on the channel, such as a new member entering the presence set.
A promise which resolves upon success of the channel attach()
operation and rejects with an ErrorInfo object upon its failure.
A PresenceAction or an array of PresenceAction
s to register the listener for.
Optional
listener: messageCallback<PresenceMessage>
An event listener function.
Registers a listener that is called each time a PresenceMessage is received on the channel, such as a new member entering the presence set.
A promise which resolves upon success of the channel attach()
operation and rejects with an ErrorInfo object upon its failure.
Optional
listener: messageCallback<PresenceMessage>
An event listener function.
Deregisters a specific listener that is registered to receive PresenceMessage on the channel for a given PresenceAction.
A specific PresenceAction to deregister the listener for.
An event listener function.
Deregisters a specific listener that is registered to receive PresenceMessage on the channel for a given array of PresenceAction objects.
An array of PresenceAction objects to deregister the listener for.
An event listener function.
Deregisters any listener that is registered to receive PresenceMessage on the channel for a specific PresenceAction
A specific PresenceAction to deregister the listeners for.
Deregisters any listener that is registered to receive PresenceMessage on the channel for an array of PresenceAction objects
An array of PresenceAction objects to deregister the listeners for.
Deregisters a specific listener that is registered to receive PresenceMessage on the channel.
An event listener function.
Deregisters all listeners currently receiving PresenceMessage for the channel.
Updates the data
payload for a presence member. If called before entering the presence set, this is treated as an ENTER event.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
Optional
data: any
The payload to update for the presence member.
Updates the data
payload for a presence member using a given clientId
. Enables a single client to update presence on behalf of any number of clients using a single connection. The library must have been instantiated with an API key or a token bound to a wildcard clientId
.
A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.
The ID of the client to update in the presence set.
Optional
data: any
The payload to update for the presence member.
Generated using TypeDoc
Enables the presence set to be entered and subscribed to, and the historic presence set to be retrieved for a channel.