Profile module
#
Get User profile dataTo get the profile data of a user(not a group) call the below method.
- Java
- Kotlin
Refer this doc to know more about Profile Class
Argument | Type | Description |
---|---|---|
USER_JID | String | Jid of the user |
FETCH_FROM_SERVER | boolean | true to fetch from server |
SAVE_AS_FRIEND | boolean | if true the user will be saved as friend and will be available in contact list |
CALLBACK | FlyCallback | FlyCallback implemented as as lambda expression |
#
Update User profileTo update your profile call the below method.
- Java
- Kotlin
info
In profile object for image property set the absolute file path of a file if a image file needs to be uploaded or else set it to profile image id.
Refer this doc to know more about Profile Class
Argument | Description | Data type |
---|---|---|
PROFILE_OBJECT | Profile | Profile object which the updated value |
CALLBACK | FlyCallback | FlyCallback implemented as as lambda expression |
#
Update profile imageTo update your profile image call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
PROFILE_IMAGE_FILE | File | file object of the profile image |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
Refer Profile to know more about Profile class.
#
Remove profile imageTo remove your profile image call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
All the contact related operation will be found below.
#
Contact SyncIf 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. This method will take care sandbox mode contact sync or live mode contact sync based on setIsTrialLicenceKey
provided.
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 |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
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
#
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 |
#
FriendsThe contacts who are in your contacts after the contact sync is considered as your friends, those people's only observe your profile,user presence updates.
#
Profile DetailsEvery single chat contact has been modelled after ProfileDetails class. It holds the data of a user name, display picture, whether you blocked them or not etc. Refer Class documentation to know about ProfileDetails Class
#
Get Friends ListOnce 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.
#
Get Non Chat Users ListIf mobile number login is enabled in ChatSDK then users who aren't chat user but in your contacts will be available by calling the below method.
- 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.
#
Block a UserTo block a user call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
JID_TO_BLOCK | String | JID of the user |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
#
Unblock a UserTo unblock a user who is blocked already call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
JID_TO_UNBLOCK | String | JID of the user |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
caution
Blocking and Unblocking valid for Single chat user only not for Group/Broadcast.
#
Get user profiles that you blockedTo get the list of chat user profiles that you blocked call the below method.
- Java
- Kotlin
Argument | Description | Type | |
---|---|---|---|
SERVER_CALL | boolean | true to get the synced list from server false to get the list from local data. default value is false | |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
Note : To make server call internet connection is required
#
Get user profiles that blocked youTo get the list of single chat user that blocked you call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
SERVER_CALL | boolean | true to get the synced list from server false to get the list from local data. default value is false |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
Note : To make server call internet connection is required
#
Get Unknown single chat ProfilesTo get the list of single chat user those are not in your contacts if you use phone number as your primary way of communication .
- Java
- Kotlin
#
Get current User statusUser can get their current user status using the below method.
- Java
- Kotlin
Refer this doc to know more about ProfileStatus Class
#
Get current User busy statusUser can get their current user busy status using the below method.
- Java
- Kotlin
Refer this doc to know more about BusyStatus Class
#
Set User statusUser can set the status for their profile using the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
STATUS_TEXT | String | Status text cannot be longer than 140 characters |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
#
Set User Busy statusUser can set the busy status message for their one to one chat conversation using the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
BUSY_STATUS_TEXT | String | busy status text cannot be longer than 140 characters |
#
Enable/Disable User Busy statusUser can enable and disable their busy status using the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
ENABLE_BUSY_STATUS | boolean | true enables busy status and false disables busy status |
#
Check User Busy status is enabledUser can check whether their busy status is enabled or disabled.
- Java
- Kotlin
#
Get the list of User saved profile statusesUser can get their list of previously saved user statuses by calling the below method.
- Java
- Kotlin
info
This list contains some pre defined values.
#
Get the list of User saved busy statusesUser can get their list of previously saved user busy statuses by calling the below method.
- Java
- Kotlin
info
This list also contains some pre defined values.
#
Delete a user StatusUser can delete their user status by calling the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
USER_STATUS | ProfileStatus | Object of the profile status that has to be deleted |
caution
User cannot delete a status which is currently selected.
#
Delete a user Busy StatusUser can delete their busy status by calling the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
USER_BUSY_STATUS | BusyStatus | Object of the user busy status that has to be deleted |
caution
User cannot delete a busy status which is currently selected.
#
Enable disable hide seen statusHide Last seen status enables the user's last logged in time unavailable to their friends. To enable or disable the hide last seen status of the user call the below method.
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
ENABLE_LAST_SEEN | boolean | true enables the last seen available to friends false disables it |
CALLBACK | FlyCallback | FlyCallback implemented as lambda expression |
#
Check last seen statusTo check whether last seen status is available to friends or not, call the below method.
- Java
- Kotlin