userID
, which can be any string that uniquely identifies the user and is immutable throughout its lifetime.A database primary key would make an idealuserID
. Conversely, something like username or emails is not recommended as those values may change over time.
userId
string
roles
Array.<string>
displayName
string
isGlobalBan
Boolean
True
means the user is globally banned.flagCount
integer
metadata
Object
createdAt
date
updatedAt
date
getAvatarInfo:
AmityImageData
avatarCustomUrl
string
isDeleted
Boolean
AmityUserRepository
class, you would be able to list all the users, search for list of users whose display name matches your search query and get AmityUser
object from user id.AmityUserRepository
displayName
is passed, it will update the user directly.displayName
is passed, but secured mode is enabled, the values will be ignored.userId
and displayName
. The userId
is immutable once the account is created. However, the displayName
can be updated at all times. AmityUserRepository
provides a convenient method getUser(_:)
which maps user id to a particular AmityUser
object. It returns a live AmityObject<AmityUser>
which you can observe too. It accepts one parameter userId
which is the ID of the user.AmityUserRepository
provides a convenient method getUsers(_:)
to fetch all users. This method will return AmityCollection<AmityUser>
. You can observe changes in collection, similar to message or channel. The method accepts AmityUserSortOption
enum as a parameter. The list can be sorted by displayName
, firstCreated
or lastCreated
.displayName
.AmityUserRepository
contains another convenient method searchUser(_:_:)
which allows you to query for any particular user using their display name. It provides you with a collection of AmityUser
whose display name matches with your search query. It accepts two parameters. The first one is the display name that you want to search for and the second one is sort option which is AmityUserSortOption
enum.AmityClient
class contains updateUser:
method which allows you to update information about current user.AmityFileRepository
and then update the image info.AmityFileRepository
AmityFileRepository
AmityImageData
from step 1 into the builder, and call user update API.AmityClient
class provides a method hasPermission(_:)
which allows you to check if the current logged in user has permission to do stuffs.