Users
#
User ListTo 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.
warning
User presence and Profile instant update will not happen until a messege is sent to that particular user.
- Java
- Kotlin
Refer this doc to know more about Profile Details Class
Argument | Type | Description |
---|---|---|
PAGE_NUMBER | int | Page number of user list default value 1 |
PER_PAGE_RESULT_SIZE | int | Number of users per page default value 50 |
SEARCH_TERM | String | text characters for which search has to happen default value empty |
META_DATA_USER_LIST | MetaDataUserList | model class which filters the results by metadata default value is empty |
CALLBACK | FlyCallback | FlyCallback implemented as as lambda expression |
#
Sync Contactwarning
It will be only applicable for mobile number registration and contact book synchronization.
If mobile number is used as a primary id for communication in chat sdk then there has to be sync between user and server. The following code block initiate the contact sync and let the user communicate with their contacts who uses the client app too.
Note : In order to sync mobile contacts need to enable
ChatManager.enableMobileNumberLogin
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
IS_FIRST_TIME | boolean | true for first time and false after when synchronising contacts |
To observe contact sync events you can either implement or create a annonymous ProfileEventsListener
interface and attach it to ChatEventsManager and detach the listener when no longer needed. To know more about other methods in ProfileEventsListener
kindly visit Profile Events
- Java
- Kotlin
To avoid unnecessay multiple contact sync calls observe the status of the contact sync beore calling syncContacts.
- Java
- Kotlin
The value of the contactSyncState can also be accessible by directly calling the get value method since it's a live data variable.
- Java
- Kotlin
#
Get Registered UsersNote : 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.
- Java
- Kotlin
Refer this doc to know more about ProfileDetails Class
Argument | Description | Data type |
---|---|---|
FETCH_FROM_SERVER | Profile | Profile object which the updated value |
caution
FlyCallback
which is used as a callback for most of the i/o operation is expressed as lambda expression for easy reading.
#
Revoke Contact SyncIf mobile number is used as a primary id for communication in chat sdk and contact sync have been completed then the following code block will delete user contacts and revoke the contact sync.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |