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

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


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