ChatConnectionListener class Null safety

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:

    ChatClient.getInstance.addConnectionListener(mConnectionListener);

Unregister:

    ChatClient.getInstance.removeConnectionListener(mConnectionListener);
Annotations
  • @Deprecated("Use ConnectionEventHandler to instead")

Constructors

ChatConnectionListener()

Properties

hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
onConnected() → void
Occurs when the SDK connects to the chat server successfully.
onDisconnected() → void
Occurs when the SDK disconnect from the chat server.
onTokenDidExpire() → void
Occurs when the token has expired.
onTokenWillExpire() → void
Occurs when the token is about to expire.
onUserAuthenticationFailed() → void
Occurs when the current chat user authentication failed.
onUserDidChangePassword() → void
Occurs when the current chat user is changed password.
onUserDidForbidByServer() → void
Occurs when the current chat user is forbid from the server.
onUserDidLoginFromOtherDevice() → void
Occurs when the current user account is logged in to another device.
onUserDidLoginTooManyDevice() → void
Occurs when the current chat user logged to many devices.
onUserDidRemoveFromServer() → void
Occurs when the current chat user is removed from the server.
onUserKickedByOtherDevice() → void
Occurs when the current chat user kicked by other device.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited