Skip to main content

Block Users

Use blockUsers() to block one or more users. All communication to and from blocked users is stopped. Pass a List<String> of UIDs to block.
In the onSuccess() callback, you receive a HashMap which contains UIDs as the keys and success or fail as the value based on whether the block operation for the UID was successful or not.

Unblock Users

Use unblockUsers() to unblock previously blocked users. Pass a List<String> of UIDs to unblock.
In the onSuccess() callback, you receive a HashMap which contains UIDs as the keys and success or fail as the value based on whether the unblock operation for the UID was successful or not.

Get List of Blocked Users

Use BlockedUsersRequestBuilder to fetch blocked users with optional filters.

Set Limit

Set the number of blocked users to fetch per request.

Set Search Keyword

Filter blocked users by a search string.

Set Direction

  • BlockedUsersRequest.DIRECTION_BLOCKED_BY_ME - Ensures that the list of blocked users only contains users blocked by the logged-in user.
  • BlockedUsersRequest.DIRECTION_HAS_BLOCKED_ME - Ensures that the list of blocked users only contains users that have blocked the logged-in user.
  • BlockedUsersRequest.DIRECTION_BOTH - Ensures the list of users includes both of the above cases. This is the default value for the direction variable if it is not set.

Fetch Blocked Users

After configuring the builder, call build() then fetchNext() to retrieve blocked users.

Next Steps

Retrieve Users

Fetch and filter user lists in your app

User Management

Learn about user objects and properties

Send Message

Send messages to users and groups

User Presence

Track user online/offline status