Block Friend Invites #

Players can block and unblock friend invites from a specific account, or block all incoming friend invites.

Blocking invites works on the account level. Thus, blocking another player prevents them from sending invites to the player across all game shards.

Block a single account #

The Friend API’s Block() method allows a player to block friend invites sent by a specific account. When a player blocks an account, the specified account, identified by the socialId, is added to the blocker’s block list. Any pending invitations from the blocked account are automatically deleted. If the players are friends, Pragma Engine removes each player from the others’ friend list before blocking.

Player->FriendApi().Block(
  const FString& SocialId, c
  onst FOnCompleteDelegate& OnComplete
);
Player.FriendApi.Block(
  PragmaId socialId, 
  CompleteDelegate onComplete
);

If a blocked player attempts to send a friend invite, they receive the Friend_BlockedByInvitee error.

Unblock a single account #

The Unblock() method allows a player to unblock an account on their block list. The specified account, identified by the socialId, is removed from the issuing player’s block list and can send them friend invites. If the blocked player was a friend before being blocked, the friend status is not restored.

Player->FriendApi().Unblock(
  const FString& SocialId, 
  const FOnCompleteDelegate& OnComplete
);
Player.FriendApi.Unblock(
  PragmaId socialId, 
  CompleteDelegate onComplete
);

View block list #

The GetBlockedList() method returns all accounts on a player’s block list.

Unreal:

Player->FriendApi().GetBlockedList();

Related events

Related errors:

Disable or enable all incoming friend invites #

Developers can allow players to disable or enable all incoming invites from any account using the DisableIncomingFriendInvites() and EnableIncomingFriendInvites() methods. By default, all players can receive invites.

Disabling or enabling incoming invites does not add or remove accounts from a player’s block list.

To disable all incoming invites, use DisableIncomingFriendInvites(). Players who attempt to send friend invites to accounts that have incoming invites disabled will receive the Friend_InviteeDisabledInvites error.

Player->FriendApi().DisableIncomingFriendInvites(
  const FOnCompleteDelegate& OnComplete
);
Player.FriendApi.DisableIncomingFriendInvites(
  CompleteDelegate onComplete
);

To enable all incoming invites, use EnableIncomingFriendInvites():

Player->FriendApi().EnableIncomingFriendInvites(
  const FOnCompleteDelegate& OnComplete
);
Player.FriendApi.EnableIncomingFriendInvites(
  CompleteDelegate onComplete
);

Related events

Related errors: