getLoggedInUser()
method. This method can also be used to check if the user is logged in or not. If the method returns null
, it indicates that the user is not logged in and you need to log the user into CometChat.
User
object containing all the information related to the logged-in user.
UsersRequest
class. To use this class i.e to create an object of the UsersRequest class, you need to use the UsersRequestBuilder
class. The UsersRequestBuilder
class allows you to set the parameters based on which the users are to be fetched.
The UsersRequestBuilder
class allows you to set the below parameters:
setSearchKeyword()
. By default the keyword is searched in both UID & Name.
true
, the user list will not contain the users blocked by the logged-in user.
status => name => UID
. If name
is pass to the sortBy()
method the user list will be sorted by name => UID
.
build()
method to get the object of the UsersRequest
class.
Once you have the object of the UsersRequest
class, you need to call the fetchNext()
method. Calling this method will return a list of User
objects containing X number of users depending on the limit set.
getUser()
method.
getUser()
method takes the following parameters:
Parameter | Description |
---|---|
UID | The UID of the user for whom the details are to be fetched |
User
object containing the details of the user is returned.
getOnlineUserCount()
method.