agora_chat_SDK 1.0.6
agora java chat SDK
|
Public Member Functions | |
void | onConnected () |
void | onDisconnected (final int errorCode) |
default void | onTokenExpired () |
default void | onTokenWillExpire () |
default void | onLogout (final int errorCode) |
The chat connection listener.
For the occasion of onDisconnected during unstable network condition, you don't need to reconnect manually, the chat SDK will handle it automatically.
There are only two states: onConnected, onDisconnected.
Note: We recommend not to update UI based on those methods, because this method is called on worker thread. If you update UI in those methods, other UI errors might be invoked. Also do not insert heavy computation work here, which might invoke other listeners to handle this connection event.
Register: ```java ChatClient.getInstance().addConnectionListener(mConnectionListener); ``` Unregister: ```java ChatClient.getInstance().removeConnectionListener(mConnectionListener); ```
void io.agora.ConnectionListener.onConnected | ( | ) |
Occurs when the SDK connects to the chat server successfully.
void io.agora.ConnectionListener.onDisconnected | ( | final int | errorCode | ) |
Occurs when the SDK disconnect from the chat server.
Note that the logout may not be performed at the bottom level when the SDK is disconnected.
Common errors are as follows: Error#USER_REMOVED,Error#USER_LOGIN_ANOTHER_DEVICE, Error#SERVER_SERVICE_RESTRICTED,Error#USER_KICKED_BY_CHANGE_PASSWORD and Error#USER_KICKED_BY_OTHER_DEVICE
default void io.agora.ConnectionListener.onLogout | ( | final int | errorCode | ) |
Occurs when the UNDERLYING SDK logs out.
Common errors are as follows: Error#USER_LOGIN_ANOTHER_DEVICE,Error#USER_REMOVED, Error#USER_BIND_ANOTHER_DEVICE,Error#SERVER_SERVICE_RESTRICTED, Error#USER_LOGIN_TOO_MANY_DEVICES,Error#USER_KICKED_BY_CHANGE_PASSWORD, Error#USER_KICKED_BY_OTHER_DEVICE
errorCode |
default void io.agora.ConnectionListener.onTokenExpired | ( | ) |
Occurs when the token has expired.
Common errors are as follows: Error#TOKEN_EXPIRED,Error#TOKEN_WILL_EXPIRE,
default void io.agora.ConnectionListener.onTokenWillExpire | ( | ) |
Occurs when the token is about to expire.