EMConnectionListener 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:
EMClient.getInstance.addConnectionListener(mConnectionListener);
Unregister:
EMClient.getInstance.removeConnectionListener(mConnectionListener);
Constructors
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
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(
int? errorCode) → 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.
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited