User

Though the SDK does not store and should not be responsible for the handling User profile data for your application; We do provide tools to make some surface-level queries and searches for existing user accounts.

User Details

Each EkoUser consists of a userId and displayName. The userId is immutable once the account is created, however the displayName can be updated at all times.

User repository

To get EkoUserRepository instance

userRepository.getAllUsers()
.sortBy(sortOption) // optional
.build()
.query()
.subscribe( { adpater.submitList(it) } )

Query User

EkoUserRepository provides a convenient method getAllUsers() to fetch all users. You can observe for changes in collection, similar to message or channel. The method accepts EkoUserSortOption as an optional parameter. The list can be sorted by displayName, firstCreated or lastCreated.

userRepository.getAllUsers()
.sortBy(sortOption) // optional
.build()
.query()
.subscribe( { adpater.submitList(it) } )

EkoUserRepository provides searchUserByDisplayName() method which allows you to query for users using their display name. It provides you with a LiveCollection of EkoUser whose display name matches with your search query. EkoUserSortOption is an optional parameter.

userRepository.searchUserByDisplayName("John")
.sortBy(sortOption) // optional
.build()
.query()
.subscribe( { adpater.submitList(it) } )

The code above will provide you with the list of users which matches with display name "John".

EkoUserSortOption

has 3 enums type 1. EkoUserSortOption.DISPLAYNAME Sort by displayName 2. EkoUserSortOption.FIRST_CREATED Sort by firstCreated 3. EkoUserSortOption.LAST_CREATED Sort by lastCreated