Get the underlying Ably realtime channel used for presence in this chat room.
The realtime channel.
Method to join room presence, will emit an enter event to all subscribers. Repeat calls will trigger more enter events.
Optional
data: unknownThe users data, a JSON serializable object that will be sent to all subscribers.
or upon failure, the promise will be rejected with an Ably.ErrorInfo object which explains the error.
Method to get list of the current online users and returns the latest presence messages associated to it.
Optional
params: RealtimePresenceParamsParameters that control how the presence set is retrieved.
or upon failure, the promise will be rejected with an Ably.ErrorInfo object which explains the error.
Method to check if user with supplied clientId is online
The client ID to check if it is present in the room.
or upon failure, the promise will be rejected with an Ably.ErrorInfo object which explains the error.
Method to leave room presence, will emit a leave event to all subscribers. If the user is not present, it will be treated as a no-op.
Optional
data: unknownThe users data, a JSON serializable object that will be sent to all subscribers.
or upon failure, the promise will be rejected with an Ably.ErrorInfo object which explains the error.
Register a listener to be called when a discontinuity is detected.
The listener to be called when a discontinuity is detected.
A response that allows control of the subscription.
Subscribe the given listener from the given list of events.
{'enter' | 'leave' | 'update' | 'present'} single event name or array of events to subscribe to
Optional
listener: PresenceListenerlistener to subscribe
Subscribe the given listener to all presence events.
Optional
listener: PresenceListenerlistener to subscribe
Method to update room presence, will emit an update event to all subscribers. If the user is not present, it will be treated as a join event.
Optional
data: unknownThe users data, a JSON serializable object that will be sent to all subscribers.
or upon failure, the promise will be rejected with an Ably.ErrorInfo object which explains the error.
This interface is used to interact with presence in a chat room: subscribing to presence events, fetching presence members, or sending presence events (join,update,leave).
Get an instance via Room.presence.