Connection Status
A read-only property that tells whether the client can place and receive calls right now. Read it before starting a call or when a push arrives.
Signature
val connectionStatus: ConnectionStatus
Values
| Android / Web value | iOS value | Meaning |
|---|---|---|
Disconnected / DISCONNECTED | VGConnectionStatusDisconnected | No session, or the session has ended |
Connecting / CONNECTING | VGConnectionStatusConnecting | Creating the session, or automatically reattaching it after the connection was lost |
Connected / CONNECTED | VGConnectionStatusConnected | The session is attached to a live socket: calls can be made and received |
Guarantee
- Never
Connectedonce the SDK has any evidence the socket is gone — a transport close or error, a missed heartbeat, or nothing heard from Vonage for more than 45 seconds (for example after the app was frozen or suspended). Every read checks this, so a read straight after the app resumes or is woken by a push is accurate. - A socket that dies silently while the app keeps running is noticed by the heartbeat: after about 4 seconds on iOS, and up to about 45 seconds on Android and the web.
Callbacks
There is no separate listener. The existing events fire exactly on this value's transitions:
| Transition | Event |
|---|---|
Connected → Connecting | onReconnecting |
Connecting → Connected, after a reconnect | onReconnection |
→ Disconnected, when the session ends on its own | onSessionError |
The first Connecting → Connected completes createSession, and deleteSession moves it to Disconnected without an event.
Related Actions
createSession— Create a sessiondeleteSession— End the current session