Delegate Method | Information |
---|---|
inConnecting | This method is triggered when CometChat SDK is trying to establish a connection to the web-socket server. |
onConnected | This method is called when CometChat SDK has successfully established a connection and is now connected. |
onDisconnected | This method is called when the CometChat SDK gets disconnected due to any issue while maintaining the connection like network fluctuations, etc. |
onFeatureThrottled | CometChat automatically toggles off certain features to prevent performance loss for end-users under various circumstances. |
onConnectionError | This method is called when the CometChat SDK encounters an error while maintaining the connection, such as network fluctuations, etc. |
connecting
method. Once the attempt to connect is successful, the connected
method is triggered thus letting the developer know that the connection is established and is active.
To receive real-time connection status, you need to register ConnectionListener
wherever you wish to receive the real-time status. You can use the addConnectionListener()
method to do so.
getConnectionStatus
property provided by CometChat SDK
CometChat.getConnectionStatus
method will return either of the below 4 values:
CometChat.CONNECTION_STATUS.CONNECTED
(connected)CometChat.CONNECTION_STATUS.CONNECTING
(connecting)CometChat.CONNECTION_STATUS.DISCONNECTED
(disconnected)CometChat.CONNECTION_STATUS.FEATURE_THROTTLED
(featureThrottled)