Profile module
All the contact related operation will be found below.
ProfileDetails#
Every 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 this doc to know more about ProfileDetails Class
Get User profile data#
To get the profile data of a user(not a group) call the below method.
| Argument | Type | Description |
|---|---|---|
| USER_JID | String | Jid of the user |
| FETCH_FROM_SERVER | Bool | true to fetch from server false will fetch from local database |
| SAVE_AS_FRIEND | Bool | if true the user will be saved as friend and will be available in list of contacts to chat |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Update your profile info#
To update your profile call the below method.
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.
| Argument | Description | Data type |
|---|---|---|
PROFILE_OBJECT | Profile | Profile object which the updated value |
| CALLBACK | FlyCallback | FlyCallback implemented as as lambda expression |
Update profile image#
To update your profile image call the below method.
| Argument | Type | Description |
|---|---|---|
| IMAGE | String | ImageURL of the profile image |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Remove Profile Image#
To remove your profile image call the below method.
| Argument | Type | Description |
|---|---|---|
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Block a User#
To block a user call the below method.
caution
If block user feature unavailable for your plan then below methods will throw 403 exception.
| Argument | Type | Description |
|---|---|---|
| JID_TO_BLOCK | String | JID of the user |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Unblock a User#
To unblock a user who is blocked already call the below method.
caution
If unblock user feature unavailable for your plan then below methods will throw 403 exception.
| Argument | Type | Description |
|---|---|---|
| JID_TO_UNBLOCK | String | JID of the user |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
caution
Blocking and Unblocking valid for Single chat user only not for Group/Broadcast.
Get user profiles that you blocked#
To get the list of chat user profiles that you blocked call the below method.
caution
If block user feature unavailable for your plan then below methods will throw 403 exception.
Refer Class documentation to know about ProfileDetails Class
| Argument | Description | Data type |
|---|---|---|
FETCH_FROM_SERVER | true to fetch from server false will fetch from local database | Bool |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Note : To make server call internet connection is required
Get user profiles that blocked you#
To get the list of single chat user that blocked you call the below method.
caution
If block user feature unavailable for your plan then below methods will throw 403 exception.
Refer Class documentation to know about ProfileDetails Class
| Argument | Description | Data type |
|---|---|---|
FETCH_FROM_SERVER | true to fetch from server false will fetch from local database | Bool |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Note : To make server call internet connection is required
Get current User busy status#
User can get their current user busy status using the below method.
Refer this doc to know more about BusyStatus Class
Set User Busy status#
User can set the busy status message for their one to one chat conversation using the below method.
| Argument | Type | Description |
|---|---|---|
| BUSY_STATUS_TEXT | String | busy status text cannot be longer than 140 characters |
| COMPLETION | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Enable/Disable User Busy status#
User can enable and disable their busy status using the below method.
| Argument | Type | Description |
|---|---|---|
| ENABLE_BUSY_STATUS | Bool | true enables busy status and false disables busy status |
| COMPLETION | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Check User Busy status is enabled#
User can check whether their busy status is enabled or disabled.
Get the list of User saved busy statuses#
User can get their list of previously saved user busy statuses by calling the below method.
info
This list also contains some pre defined values.
Delete a user Busy Status#
User can delete their busy status by calling the below method.
| Argument | Type | Description |
|---|---|---|
| STATUS_ID | String | 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 status#
Hide 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.
| Argument | Type | Description |
|---|---|---|
| EnableLastSeen | Bool | true enables the last seen available to friends false disables it |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Check last seen status#
To check whether last seen status is available to friends or not, call the below method.
Get last seen status#
To get whether last seen status is available to friends or not, call the below method.
| Argument | Type | Description |
|---|---|---|
| JID_TO_GETLASTSEEN | String | JID of the user |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Note: If response is 0 on getdata then its user is in online or will receive timestamp.
Delete My Account#
To delete your chat account call the below method. This will clear your profile,login information and messages(including media files) in the server as well as in your device. No information will be retained after account deletion. And if registration is made again with the same account it will be treated as a new account.
| Argument | Type | Description |
|---|---|---|
| REASON | String | Reason for the account deletion |
| FEEDBACK | String | Feedback for tha app if any |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
caution
Once account is deleted the user will be removed from every group in which is he/her is a participant.
Get the list of User saved profile statuses#
User can get their list of previously saved user statuses by calling the below method.
info
This list contains some pre defined values. ProfileStatus reference document
Create user profile status#
User can create the status for their profile using the below method.
| Argument | Type | Description |
|---|---|---|
| STATUSTEXT | String | statusText of the current status |
| CURRENTSTATUS | Bool | currentStatus of the selected status |
Update user profile status#
User can set the status for their profile using the below method.
| Argument | Type | Description |
|---|---|---|
| STATUSID | String | statusId of the status |
| STATUSTEXT | String | statusText of the current status |
| CURRENTSTATUS | Bool | currentStatus of the selected status |