Moderation

Block a User#

To block a user call the below method.

FlyCore.blockUser(JID_TO_BLOCK,(isSuccess, throwable, data) -> {
if (isSuccess) {
//User is blocked update the UI
} else {
//User blocking failed print throwable to find the exception details
}
});
ArgumentTypeDescription
JID_TO_BLOCKStringJID of the user
CALLBACKFlyCallbackFlyCallback implemented as lambda expression
caution

If block feature unavailable for your plan then it will throw 403 exception.

Unblock a User#

To unblock a user who is blocked already call the below method.

FlyCore.unblockUser(JID_TO_UNBLOCK,(isSuccess, throwable, data) -> {
if (isSuccess) {
//User is unblocked update the UI
} else {
//User unblocking failed print throwable to find the exception details
}
});
ArgumentTypeDescription
JID_TO_UNBLOCKStringJID of the user
CALLBACKFlyCallbackFlyCallback implemented as lambda expression
caution

Blocking and Unblocking valid for Single chat user only not for Group/Broadcast.

caution

If block feature unavailable for your plan then it will throw 403 exception.

Get user profiles that you blocked#

To get the list of chat user profiles that you blocked call the below method.

FlyCore.getUsersIBlocked(SERVER_CALL,(isSuccess, throwable, data) -> {
if (isSuccess) {
ArrayList<ProfileDetails> profilesList = (ArrayList<ProfileDetails>) data.get("data")
} else {
//Getting users that you blocked failed print throwable to find the exception details
}
});
ArgumentDescriptionType
SERVER_CALLbooleantrue to get the synced list from server false to get the list from local data. default value is false
CALLBACKFlyCallbackFlyCallback implemented as lambda expression

Note : To make server call internet connection is required

caution

If block feature unavailable for your plan then it will throw 403 exception.

Get user profiles that blocked you#

To get the list of single chat user that blocked you call the below method.

FlyCore.getUsersWhoBlockedMe(SERVER_CALL,(isSuccess, throwable, data) -> {
if (isSuccess) {
ArrayList<ProfileDetails> profilesList = ( ArrayList<ProfileDetails>) data.get("data")
} else {
//Getting users blocked me list failed print throwable to find the exception details
}
});
ArgumentTypeDescription
SERVER_CALLbooleantrue to get the synced list from server false to get the list from local data. default value is false
CALLBACKFlyCallbackFlyCallback implemented as lambda expression

Note : To make server call internet connection is required

caution

If block feature unavailable for your plan then it will throw 403 exception.

Mute user/Group#

If you want to mute the notifications for the chat of a user or a group, you can utilise the below method.

FlyCore.updateChatMuteStatus(JID , MUTE_STATUS);
ArgumentTypeDescription
JIDStringjid of the chat user/ group
MUTE_STATUSbooleantrue, if you want to mute notifications for the chat

Encrypt/Decrypt media files#

To encrypt all media files while uploading to server, call below method to enable media encryption in SDK

ChatManager.setMediaEncryption(true);

Note: If this flag enabled then all type of media files will be encrypted while uploading and stored in server, On receiver side media files will be decrypted while downloading and readable file will be stored in local storage.

Report User/Group Messages#

This feature is used to do report the user/group messages by selecting the message or user/group profile. If the user/group is reported by person to admin, the user's last 5 conversations or by selecting along with the selected message and previous 4 messages will be sent to the admin panel based on that chats availability. By using the below method person can achieve the User/Group report messages.

FlyCore.reportUserOrMessages(TO_USER_JID, CHAT_TYPE, SELECTED_MID, (isSuccess, throwable, data) -> {
if (isSuccess) {
// Report Success Response
} else {
// Report Failure Response
}
});

Note : In this method SELECTED_MID is optional argument. If person selected a message to report use this param other wise ignore the param.

ArgumentTypeDescription
TO_USER_JIDstringReport User Jid who needs to be reported
CHAT_TYPEstringUser chat type either single chat or group chat
SELECTED_MIDstringSelected Message ID
caution

If report chat feature unavailable for your plan then it will throw 403 exception.

Handling Banned User/Group#

This feature is used to get the users/groups admin blocked status. So that you can check the user/group available status and communicate with them. If user/group blocked by admin then you will get notify the alert message.

Get Own user Admin Block Status#

This method is used to get the live status of own user profile blocked/unblocked by Admin status, so that you will be navigated to show stopper screen if profile blocked by admin.

@override
public void onAdminBlockedUser(String jid, boolean status) {
super.onAdminBlockedUser(jid, status)
// jid - own user profile jid, status - admin block/unblock status
// Write your logic here
// to show/hide showstopper screen, based on the admin block/unblock status
}
// To get the own user admin block/unblock status by using the below method while app is opening from background
FlyCore.getIsProfileBlockedByAdmin();

Get Other user/group Admin Block Status#

This method is used to get the live status of other user/group profile blocked/unblocked by Admin status, so that you will be notified the profile status.

@override
public void onAdminBlockedOtherUser(String jid, String type, boolean status) {
super.onAdminBlockedOtherUser(jid, type, status)
// jid - user/group profile jid, type - chat/groupchat, status - admin block/unblock status
// Write your logic here to handle the user/group communications
}