Users & Contacts List

User List#

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

warning

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

await SDK.getUsersList(`SEARCH_TERM`, `PAGE_NUMBER`, `LIMIT`, `META_DATA_FILTER`);

Request Params#

ArgumentsDescriptionTypeRequired
SEARCH_TERMSearch term to search against the name default value is emptyStringfalse
PAGE_NUMBERPage number to get the particular pages default value is 1Numberfalse
LIMITLimit to set the number of users per page default value is 20Numberfalse
META_DATA_FILTERMetaDataFilter which filters the results by metadata default value is emptyObjectfalse

Sample Format for MetaDataFilter#

{
metaDataKey : "",
metaDataValues: []
}
Request Input for MetaDataKey#
ArgumentsDescriptionType
metaDataKeyName of the KeyString
valueName of the valueString
Request Input for MetaDataValues#
ArgumentsDescriptionType
metaDataValuesName of the KeyString
valueName of the valueArray of String or Boolean or Number

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString
totalPagesTotal pages based on the limitNumber
totalUsersTotal users registered to the applicationNumber
usersArray of Users ObjectArray

Response Format:#

data: [
{
name: "", // String - Name of the User
image: "", // String - Profile Image of the User
thumbImage: "", // String - Profile ThumbImage of the User
email: "", // String - User Email
status: "", // String - User Status
userJid: "", // String - Jid of the User
userId: "", // String - User Id
nickName: "", // String - Nick Name of the User
mobileNumber: "", // String - User Mobile Number
isAdminBlocked: false, // Boolean - To denote whether admin blocked this account or not
},
//...
];

Get Registered Users#

The registered users who are all in your contacts will be retrieved using this method. The contact sync should be done in the mobile(Android/iOS) application.

warning

Profile and user presence updates will be observed to the contacts who are all in your mobile(Android/iOS) application.

await SDK.getRegisteredUsers();

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString
dataArray of Users ObjectArray

Response Format:#

data: [
{
name: "", // String - Name of the User
image: "", // String - Profile Image of the User
email: "", // String - User Email
status: "", // String - User Status
userJid: "", // String - Jid of the User
userId: "", // String - User Id
nickName: "", // String - Nick Name of the User
mobileNumber: "", // String - User Mobile Number
isAdminBlocked: false, // Boolean - To denote whether admin blocked this account or not
},
//...
];
note

friendsListListener also will be triggered with the same response.