Configure automatic session termination when a user is alone in a call. Idle timeout helps manage resources by ending sessions that have no active participants.Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
How Idle Timeout Works
When a user is the only participant in a call session, the idle timeout countdown begins. If no other participant joins before the timeout expires, the session automatically ends and theonSessionTimedOut callback is triggered.
The timer also restarts when other participants leave and only one user remains in the call.
This is useful for:
- Preventing abandoned call sessions from running indefinitely
- Managing server resources efficiently
- Providing a better user experience when the other party doesn’t join
Configure Idle Timeout
Set the idle timeout period usingsetIdleTimeoutPeriod() in SessionSettingsBuilder. The value is in seconds.
| Parameter | Type | Default | Description |
|---|---|---|---|
idleTimeoutPeriod | int | 300 | Timeout in seconds when alone in the session |
Handle Session Timeout
Listen for theonSessionTimedOut callback using SessionStatusListener to handle when the session ends due to idle timeout:
Flutter listeners are not lifecycle-aware. You must manually remove listeners in your widget’s
dispose() method to prevent memory leaks.Disable Idle Timeout
To disable idle timeout and allow sessions to run indefinitely, set a value of0: