ChatContactEventHandler class

~english The contact event handler.

Occurs when the contact changes, including adding or deleting contacts and accept or rejecting friend requests.

Adds a contact event handler:

  ChatClient.getInstance.contactManager.addEventHandler(UNIQUE_HANDLER_ID, ChatContactEventHandler());

Removes a contact event handler:

  ChatClient.getInstance.contactManager.removeEventHandler(UNIQUE_HANDLER_ID);

~end

~chinese 联系人事件监听

添加监听:

  ChatClient.getInstance.contactManager.addEventHandler(UNIQUE_HANDLER_ID, ChatContactEventHandler());

移除监听:

  ChatClient.getInstance.contactManager.removeEventHandler(UNIQUE_HANDLER_ID);

~end

Constructors

ChatContactEventHandler({void onContactAdded(String userId)?, void onContactDeleted(String userId)?, void onContactInvited(String userId, String? reason)?, void onFriendRequestAccepted(String userId)?, void onFriendRequestDeclined(String userId)?})
~english The contact updates listener callback.

Properties

hashCode int
The hash code for this object.
no setterinherited
onContactAdded → (void Function(String userId)?)
~english Occurs when user is added as a contact by another user. ~end
final
onContactDeleted → (void Function(String userId)?)
~english Occurs when a user is removed from the contact list by another user. ~end
final
onContactInvited → (void Function(String userId, String? reason)?)
~english Occurs when a user receives a friend request. ~end
final
onFriendRequestAccepted → (void Function(String userId)?)
~english Occurs when a friend request is approved. ~end
final
onFriendRequestDeclined → (void Function(String userId)?)
~english Occurs when a friend request is declined. ~end
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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