Skip to main content
Empower users to control their social experience by blocking or unblocking other users. Blocking is essential for user safety, privacy, and content control.

User Safety

Protect users from harassment and unwanted interactions

Content Control

Give users control over their social environment

Spam Prevention

Filter out spam and inappropriate content effectively
Only users can be blocked. Console Admins and communities cannot be blocked. Community moderators or custom roles can be blocked regardless of their roles.

Product Behavior

  • When User is Blocked
  • When User is Unblocked

Content Visibility

  • Global feed content hidden
  • Community feed content hidden
  • User feed content hidden
  • Search functionality remains active

Interaction Restrictions

  • Blocked user’s connection status as blocked.
  • Cannot create posts on blocker’s feed
  • Cannot follow the blocker
*Some limitations apply - If Alice blocks Bob, and either of them knows the other’s post ID, they can still comment on or react to each other’s posts.

Parameters

userId

Type: String
Required: Yes
The unique identifier of the user to block or unblock.

Block User

// Block a user by userId
 do {
    try await userRelationship.blockUser(userId: "user-id")
    print("User blocked successfully")
} catch let error {
    print("Unable to block user \(error)")
}

Unblock User

// Unblock a user by userId
do {
    try await userRelationship.unblockUser(userId: "user-id")
    print("User unblocked successfully")
} catch let error {
    print("Unable to unblock user \(error)")
}

Best Practices

  • Always provide confirmation dialogs for blocking/unblocking actions.
  • Clearly indicate blocked status in the UI.
  • Allow users to manage their blocked list easily.
  • Never notify users when they are blocked.
  • Ensure all blocked user content and interactions are hidden.
  • Respect privacy and content visibility settings.