Retrieve User List

Get User List#

To retrive all registered users on MirrorFly SDK use below method. User list can also be retrived based on search key word, also this method supports pagination. This function will return the total number of pages.


User presence and Profile instant update will not happen until a messege is sent to that particular user.

FlyCore.getUserList(PAGE_NUMBER, PER_PAGE_RESULT_SIZE, SEARCH_TERM, META_DATA_USER_LIST, (isSuccess, throwable, data) -> {
if (isSuccess) {
ArrayList<ProfileDetails> userList = (ArrayList<ProfileDetails>) data.get("data");
Integer totalPage = (Integer) data.get("total_pages");
//User list fetched. Update the UI
} else {
//Get user list failed print throwable to find the details

Refer this doc to know more about Profile Details Class

PAGE_NUMBERintPage number of user list default value 1
PER_PAGE_RESULT_SIZEintNumber of users per page default value 50
SEARCH_TERMStringtext characters for which search has to happen default value empty
META_DATA_USER_LISTMetaDataUserListmodel class which filters the results by metadata default value is empty
CALLBACKFlyCallbackFlyCallback implemented as as lambda expression

Get Registered Phonebook Contact Users#

Note : The registered contacts who are in your contacts will retrieved after the contact sync, those people's only observe your profile,user presence updates.

Once we started communicating , we can get the list of contact with chat data with whom we communicated so far.

FlyCore.getRegisteredUsers(FETCH_FROM_SERVER,(isSuccess, throwable, data) -> {
if (isSuccess) {
ArrayList<ProfileDetails> registeredUsers = (ArrayList<ProfileDetails>) data.get("data");
//Registered users fetched. Update the UI
} else {
//Fetching registered users failed print throwable to find the exception details

Refer this doc to know more about ProfileDetails Class

ArgumentDescriptionData type
FETCH_FROM_SERVERProfileProfile object which the updated value

FlyCallback which is used as a callback for most of the i/o operation is expressed as lambda expression for easy reading.

Get Non-Registered Phonebook Contact Users#

To get the list of single chat user those are not in your contacts if you use phone number as your primary way of communication .

List<ProfileDetails> unknownProfilesList = FlyCore.getUnKnownProfiles();