EMGroupEventHandler class

群组事件监听

添加监听:

  EMClient.getInstance.groupManager.addEventHandler(UNIQUE_HANDLER_ID, EMGroupEventHandler());

移除监听:

  EMClient.getInstance.groupManager.removeEventHandler(UNIQUE_HANDLER_ID);

Constructors

EMGroupEventHandler({void onAdminAddedFromGroup(String groupId, String admin)?, void onAdminRemovedFromGroup(String groupId, String admin)?, void onAllGroupMemberMuteStateChanged(String groupId, bool isAllMuted)?, void onAllowListAddedFromGroup(String groupId, List<String> members)?, void onAllowListRemovedFromGroup(String groupId, List<String> members)?, void onAnnouncementChangedFromGroup(String groupId, String announcement)?, void onAutoAcceptInvitationFromGroup(String groupId, String inviter, String? inviteMessage)?, void onGroupDestroyed(String groupId, String? groupName)?, void onInvitationAcceptedFromGroup(String groupId, String invitee, String? reason)?, void onInvitationDeclinedFromGroup(String groupId, String invitee, String? reason)?, void onInvitationReceivedFromGroup(String groupId, String? groupName, String inviter, String? reason)?, void onMemberExitedFromGroup(String groupId, String member)?, void onMemberJoinedFromGroup(String groupId, String member)?, void onMuteListAddedFromGroup(String groupId, List<String> mutes, int? muteExpire)?, void onMuteListRemovedFromGroup(String groupId, List<String> mutes)?, void onOwnerChangedFromGroup(String groupId, String newOwner, String oldOwner)?, void onRequestToJoinAcceptedFromGroup(String groupId, String? groupName, String accepter)?, void onRequestToJoinDeclinedFromGroup(String groupId, String? groupName, String? decliner, String? reason, String? applicant)?, void onRequestToJoinReceivedFromGroup(String groupId, String? groupName, String applicant, String? reason)?, void onSharedFileAddedFromGroup(String groupId, EMGroupSharedFile sharedFile)?, void onSharedFileDeletedFromGroup(String groupId, String fileId)?, void onUserRemovedFromGroup(String groupId, String? groupName)?, void onSpecificationDidUpdate(EMGroup group)?, void onDisableChanged(String groupId, bool isDisable)?, void onAttributesChangedOfGroupMember(String groupId, String userId, Map<String, String>? attributes, String? operatorId)?})
群组时间监听

Properties

hashCode int
The hash code for this object.
read-onlyinherited
onAdminAddedFromGroup → (void Function(String groupId, String admin)?)
成员设置为管理员的回调。
final
onAdminRemovedFromGroup → (void Function(String groupId, String admin)?)
取消成员的管理员权限的回调。
final
onAllGroupMemberMuteStateChanged → (void Function(String groupId, bool isAllMuted)?)
全员禁言状态变化回调。
final
onAllowListAddedFromGroup → (void Function(String groupId, List<String> members)?)
成员加入群组白名单回调。
final
onAllowListRemovedFromGroup → (void Function(String groupId, List<String> members)?)
成员移出群组白名单回调。
final
onAnnouncementChangedFromGroup → (void Function(String groupId, String announcement)?)
群公告更新回调。
final
onAttributesChangedOfGroupMember → (void Function(String groupId, String userId, Map<String, String>? attributes, String? operatorId)?)
群组成员自定义属性有变更。
final
onAutoAcceptInvitationFromGroup → (void Function(String groupId, String inviter, String? inviteMessage)?)
当前用户自动同意入群邀请的回调。 设置请见 EMOptions.autoAcceptGroupInvitation.
final
onDisableChanged → (void Function(String groupId, bool isDisable)?)
群是禁用状态变更。
final
onGroupDestroyed → (void Function(String groupId, String? groupName)?)
当前用户收到群组被解散的回调。
final
onInvitationAcceptedFromGroup → (void Function(String groupId, String invitee, String? reason)?)
当前用户收到对端用户同意入群邀请触发的回调。
final
onInvitationDeclinedFromGroup → (void Function(String groupId, String invitee, String? reason)?)
当前用户收到群组邀请被拒绝的回调。 该回调是由当前用户收到对端用户拒绝入群邀请触发的。例如,用户 B 拒绝了用户 A 的群组邀请,用户 A 会收到该回调。
final
onInvitationReceivedFromGroup → (void Function(String groupId, String? groupName, String inviter, String? reason)?)
当前用户收到入群邀请的回调。
final
onMemberExitedFromGroup → (void Function(String groupId, String member)?)
群组成员主动退出回调。
final
onMemberJoinedFromGroup → (void Function(String groupId, String member)?)
新成员加入群组的回调。
final
onMuteListAddedFromGroup → (void Function(String groupId, List<String> mutes, int? muteExpire)?)
有成员被禁言回调。 用户禁言后,将无法在群中发送消息,但可查看群组中的消息,而黑名单中的用户无法查看和发送群组消息。
final
onMuteListRemovedFromGroup → (void Function(String groupId, List<String> mutes)?)
有成员被解除禁言的回调。
final
onOwnerChangedFromGroup → (void Function(String groupId, String newOwner, String oldOwner)?)
转移群主权限的回调。
final
onRequestToJoinAcceptedFromGroup → (void Function(String groupId, String? groupName, String accepter)?)
对端用户接受当前用户发送的群组申请的回调。
final
onRequestToJoinDeclinedFromGroup → (void Function(String groupId, String? groupName, String? decliner, String? reason, String? applicant)?)
对端用户拒绝群组申请的回调。
final
onRequestToJoinReceivedFromGroup → (void Function(String groupId, String? groupName, String applicant, String? reason)?)
对端用户接收群组申请的回调。
final
onSharedFileAddedFromGroup → (void Function(String groupId, EMGroupSharedFile sharedFile)?)
群组添加共享文件回调。
final
onSharedFileDeletedFromGroup → (void Function(String groupId, String fileId)?)
群组删除共享文件回调。
final
onSpecificationDidUpdate → (void Function(EMGroup group)?)
群详情变更回调。
final
onUserRemovedFromGroup → (void Function(String groupId, String? groupName)?)
当前用户被移出群组时的回调。
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

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