CometChatConnectionDelegate
class.
Connection Status provides you with the below 3 methods to get the status of the connection to CometChat web-socket servers:
Delegate Method | Information |
---|---|
connecting | This method is triggered when CometChat SDK is trying to establish a connection to the web-socket server. |
connected | This method is called when CometChat SDK has successfully established a connection and now is connected. |
disconnected | This method is called when the CometChat SDK gets disconnected due to any issue while maintaining the connection like 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.
In order to use the Delegate methods you must add protocol conformance CometChatConnectionDelegate
as CometChat.conectiondelegate = self
. Here is the example of CometChatConnectionDelegate:
getConnectionStatus
property provided by CometChat SDK
CometChat.getConnectionStatus
method will return either of the below 3 values: