User Presence
ART provides a robust User Presence feature that delivers real-time insights into user activity across all channels. Leveraging the Aiotrix Development Toolkit (ADK), developers can quickly determine who is online at any given moment within a channel.
This feature continuously updates the presence list, enabling your application to listen for these updates and trigger specific functionalities based on a user's online status. With User Presence, applications gain enhanced visibility into user activity, which can be leveraged for numerous real-time functions.
How It Works?
ART's User Presence feature operates by maintaining a dynamic list of active users within each channel. When a user connects or disconnects, their presence status is immediately updated. Your application, utilizing the ADK, can subscribe to these presence updates. This allows you to receive notifications in real-time as users come online, go offline, or change their status, enabling your application to react and update its interface or logic accordingly.
The fetchPresence() method provides real-time presence information by returning a list of connected users.
- JavaScript
// Listen for active users in the channel
subscription.fetchPresence((users) => {
console.log("Active users:", users);
});
To track the user presence in a channel, enable presence tracking while creating the channel
To learn more about Channel creation, click here