Problem
A developer reported he is having issue where he receives callback of onPresenceEvent() while user join or leave the channel but the joinUserList: [], leaveUserList: [] array are empty.
Root Cause
Users will only receive notifications for joinUserList and leaveUserList events in Interval Mode (Scheduled Notification Mode). When users in the channel reach the setting value, the event notifications are sent at intervals rather than in real time.
The presence event notification mode determines how subscribed users receive event notifications. There are two modes:
Announce Mode – Real-time notifications
Interval Mode – Scheduled notifications
How Notification Modes Work:
In Announce Mode (real-time):
When a user joins a channel for the first time, the server pushes a snapshot of all current users and their statuses to the user. If the number of instant notifications in the channel is less than the Max number of instant event value, presence event notifications operate in real-time notification mode
In Interval Mode (scheduled):
Notifications are not sent immediately but are aggregated and delivered based on the Timed event notification interval set in the Presence Configuration in the Agora Console. The interval value ranges from 5 to 300 seconds, with a default of 30 seconds.
To switch to Interval Mode, the number of online users in the channel must exceed the Max number of instant events value, which is a setting available in the Agora Console. The value range is 8–128, with a default value of 50. This value specifies the threshold for switching from real-time to interval-based notifications.
Solution
In the developer's case, the number of user join/leave events hasn't reached the Max number of instant events limit set in the console. This means the system is operating in Announce Mode (real-time notifications), not Interval Mode.
Since the system is not in Interval Mode, the joinUserList and leaveUserList arrays remain empty because no aggregated event data is being sent. Instead, they received real-time snapshot data of all users in the channel upon joining.
References