connect
Connects to the RCserver. This method should be called only once globally in the entire application and must be invoked after init. If you are using IMKit, please use the method of the same name in IMCenter to establish a connection with the RCserver instead of using this method.
When this method is called, the SDK will continuously attempt to reconnect until one of the following two scenarios occurs: First, the connection is successful, and the onSuccess(userId) callback is triggered. Second, an error that the SDK cannot handle occurs (e.g., an invalid token), and the onError(errorCode) callback is triggered, after which no further reconnection attempts are made. If you do not want to keep retrying, you can use the connect(String, int, ConnectCallback) method and set a connection timeout limit (timeLimit). Once the connection is successful, the SDK will handle all reconnection processes. In case of a network disconnection, the SDK will continuously retry until the connection is re-established, without requiring any additional connection operations from you.
Return
RongCoreClient An instance of the IM client core class.
Since
5.0.0
Parameters
The user authentication token (Token) obtained from the server.
The callback for the connection result.
Retrieves an instance of the IMLib interface class. This method must be called after initializing the SDK with the init method; otherwise, it returns null.
Return
An instance of the IMLib interface class.
Since
5.0.0