CometChatAddMembers
is a Component that empowers administrators or group owners with the ability to expand group membership by seamlessly adding new participants. This component facilitates effortless management of group membership and enhances collaboration within the group’s discussions and activities. Administrators can meticulously select desired users to join the group, whether by targeted search or from a list of available users. Selected users receive notifications, streamlining the process of joining the group and ensuring smooth integration into the community.
CometChatAddMembers
component is composed of the following BaseComponents:
Components | Description |
---|---|
CometChatUsers | CometChatUsers is a standalone component that presents a user list and enables targeted user searches. As a container inheriting from CometChatListBase , it seamlessly incorporates the CometChatUserList component. This setup streamlines user browsing and search capabilities, enhancing overall usability and facilitating efficient interactions. |
CometChatListItem | This component renders information extracted from a User object onto a tile, featuring a title, subtitle, leading view, and trailing view. experience, facilitating seamless navigation and interaction within the component. |
CometChatAddMembers
, as a custom view controller, offers flexible integration options, allowing it to be launched directly via button clicks or any user-triggered action. Additionally, it seamlessly integrates into tab view controllers. With add members, users gain access to a wide range of parameters and methods for effortless customization of its user interface.
The following code snippet exemplifies how you can seamlessly integrate the AddMembers component into your application.
setOnItemClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
setOnItemLongClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
On Error
and improve error handling.
SetOnBack
feature. This capability allows you to customize the behavior associated with navigating back within your app. Utilize the provided code snippet to override default behaviors and tailor the user experience according to your specific requirements.
Component
. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders
of Chat SDK.
Methods | Type | Description |
---|---|---|
setLimit | Int | Configure the maximum number of groups to fetch in a single request, optimizing pagination for smoother navigation. |
setSearchKeyword | String | Employed to retrieve groups that match the provided string, facilitating precise searches. |
setTags | [String] | used for fetching users containing the passed tags |
setRoles | [String] | used for fetching users containing the passed tags |
setUIDs | [String] | used for fetching users containing the passed users |
setStatus | CometChat.UserStatus | used for fetching users by their status online or offline |
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
Events emitted by the Join Group component is as follows.
Event | Description |
---|---|
onGroupMemberAdd | Triggers when a user added to a group successfully |
Avatar
component in the Add Members Component, you can use the following code snippet. For further insights on Avatar
Styles refer
ListItemStyle
component in the Add Members
Component, you can use the following code snippet. For further insights on ListItemStyle
Styles refer
Property | Description | Code |
---|---|---|
Title | Custom title for the component | .set(title: String, mode: UINavigationItem.LargeTitleDisplayMode) |
BackButtonTitle | Custom text for the back button | .set(backButtonTitle: String?) |
SearchPlaceholderText | Custom placeholder text for search field | .set(searchPlaceholder: String) |
ShowBackButton | Whether to hide the back button | .show(backButton: Bool) |
ErrorStateText | Custom error state text | .set(errorStateText: String) |
BackButtonIcon | Custom back button icon | .set(backButtonIcon: UIImage) |
HideAddButton | Whether to hide the add button | .hide(addButton: Bool) |
SearchPlaceholder | Set the placeholder for search bar | set(searchPlaceholder: String) |
SearchIcon | Sets the icon for the search bar | set(searchIcon:UIImage) |
SearchClearIcon | Sets the clear icon for the search bar | set(searchClearIcon:UIImage) |
SearchBarHeight | Set the height for the search bar | set(searchBarHeight: CGFloat) |
HideSearch | Hide / unhide the search bar as per boolean value | hide(search: Bool) |
SelectionMode | This enables a selection, it has three modes: .single, .multiple | selectionMode(mode: SelectionMode) |
HideSeparator | This method will hide the separator | hide(separator: Bool) |
DisableUserPresence | This method disables user’s online/offline status | disable(userPresence: Bool) |
UpdateUser | This method specifies the option to update user object locally | .update(user: User) |
RemoveUser | This method specifies the option to remove user object locally | .remove(user: User) |
Add Members
component does not provide additional functionalities beyond this level of customization.
CustomListItemGroupView
and pass it inside the setListItemView()
method.
CometChatAddMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..setSubtitleView()
method. But keep in mind, by using this you will override the default Subtitle view functionality.
Custom_Subtitle_GroupMember_View
a UIView file.
CometChatAddMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..set(emptyView: UIView)
to match the empty view of your app.
Custom_Empty_State_GroupView
a UIView file.
CometChatAddMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller..set(errorView: UIView)
to match the error view of your app.
Custom_ErrorState_GroupView
and pass it inside the .set(errorView: UIView)
method.
CometChatAddMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.CometChatAddMembers
, enhancing its interface with a personalized menu
for a more user-friendly experience.
CometChatAddMembers
. If a navigation controller is already in use, utilize the pushViewController function instead of directly presenting the view controller.