userID, which can be any string that uniquely identifies the user and is immutable throughout its lifetime.
A database primary key would make an ideal
userID. Conversely, something like username or emails is not recommended as those values may change over time.
AmityUserRepositoryclass, you would be able to list all the users, search for list of users whose display name matches your search query and get
AmityUserobject from user id.
Amityserconsists of a
userIdis immutable once the account is created, however, the
displayNamecan be updated at all times.
AmityUserRepositoryprovides a convenient method
getUsers()to fetch all users. You can observe for changes in collection, similar to message or channel. The method accepts
AmityUserSortOptionas an optional parameter. The list can be sorted by displayName, firstCreated or lastCreated.
searchUserByDisplayName()method which allows you to query for users using their display name. It provides you with a LiveCollection of
AmityUserwhose display name matches your search query.
AmityUserSortOptionis an optional parameter.
AmityUserSortOption.DISPLAYNAMESort by displayName 2.
AmityUserSortOption.FIRST_CREATEDSort by firstCreated 3.
AmityUserSortOption.LAST_CREATEDSort by lastCreated