autoEstablishSocketConnection()
method provided by the AppSettingsBuilder
class. This method takes a boolean value as an input. If set to true
, the SDK will manage the web-socket connection internally based on the default behaviour mentioned above. If set to false
, the web socket connection can will not be managed by the SDK and you will have to handle it manually. You can refer to the below code snippet for the same:connect()
and disconnect()
methods provided by the SDK.connect()
method provided by the CometChat
class to establish the connection to the web-socket server. Please make sure that the user is logged in to the SDK before calling this method. You can use the CometChat.getLoggedInUser() method to check this. Once the connection is established, you will start receiving all the real-time events for the logged in user
disconnect()
method provided by the CometChat
class to break the established connection. Once the connection is broken, you will stop receiving all the real-time events for the logged in user.