AI Integration Quick Reference
AI Integration Quick Reference
Block Users
Block users to prevent all communication with them. UseblockUsers() with an array of UIDs.
- TypeScript
- JavaScript
"success" or "fail" as values. Each User in the request is processed independently.
Unblock Users
Unblock previously blocked users usingunblockUsers() with an array of UIDs.
- TypeScript
- JavaScript
"success" or "fail" as values. Each User in the request is processed independently.
Get List of Blocked Users
UseBlockedUsersRequestBuilder to fetch blocked users with filtering and pagination.
Set Limit
Sets the number of blocked users to fetch per request.- TypeScript
- JavaScript
Set Search Keyword
With offline support on, this filter is answered by the server only;
onCachedUsers does not fire.- TypeScript
- JavaScript
Set Direction
Filters by block direction:BLOCKED_BY_ME— Users blocked by the logged-in userHAS_BLOCKED_ME— Users who have blocked the logged-in userBOTH— Both directions (default)
- TypeScript
- JavaScript
- JavaScript
- JavaScript
fetchNext() method returns an array of User objects representing blocked users.
Relevant fields to access on returned users:
Offline Behaviour
With offline support enabled,BlockedUsersRequest.fetchNext() accepts a UserFetchListener and first delivers onCachedUsers from the SDK’s own blocked-users list, which it refreshes on login and on reconnect and updates when you call blockUsers() or unblockUsers(). Then onServerUsers delivers the live page to reconcile by uid; the server page is not saved to the device. The cached page is empty when no users are blocked. When setSearchKeyword() is set, the cached phase is skipped, so onCachedUsers does not fire. Offline, the read ends with onError with code FAILED_TO_FETCH after the cached page, or with onError alone when the cached phase is skipped. See Show Cached Data.
Next Steps
Retrieve Users
Fetch and filter user lists
User Presence
Track online/offline status of users
User Management
Create, update, and delete users
Flag Message
Report inappropriate messages from users