Friend SDK Reference #

This section provides references for Friend service methods, classes, and events in the Pragma SDK for Unreal and Unity. For information on Pragma Engine backend classes and plugins, see Friend Backend Reference.

Friend API #

The table below contains a list of the SDK methods relevant to the Friend service. These methods are available via the FriendApi.

Calldescription
AcceptFriendInviteAccepts a friend invite. Inviter and invitee are added to each other’s friend list
BlockAllows a player top block another player from sending them invites by adding them to a blocklist
DeclineFriendInviteDeclines a friend invite
DisableIncomingFriendInvitesPrevents a player from receiving friend invites
EnableIncomingFriendInvitesAllows player to receive friend invites
ForceSyncForcibly synchronizes the player client FriendApi with the friend information in the Pragma Engine backend
GetFriendsRetrieves a list of Friend objects in a player’s friend list
GetReceivedInvitesRetrieves a list of Friend Overview objects representing players whose friend invites you have not yet accepted/rejected
GetSentInvitesRetrieves a list of Friend Overview objects representing players who have not responded yet to your friend invites
GetBlockedListRetrieves a list of Friend Overview object representing players who are blocked from sending the player a friend invite
InitializeInitializes the Friend API. Required to use the Friend SDK functions.
RemoveFriendRemoves a friend from your friend list using the friend’s social ID
SendFriendInviteByDisplayNameSends an invite using the invitee’s display name
SendFriendInviteBySocialIdSends an invite using the invitee’s social ID
UnblockRemoves a player from another player’s blocklist, allowing the unblocked player to send the unblocker friend invites

Unreal classes #

The SDK for Unreal makes use of Pragma-defined Unreal classes. The following sections list methods available on each class:

FPragmaFriend #

methodreturns
SocialId()friend’s social ID
DisplayName()friend’s Pragma account display name
PlayerId()friend’s player ID
PlayerIdByGameShard()list of friend’s player IDs across game shards
Presence()list of friend’s FPragmaPresence
PresenceByGameShard()list of friend’s FPragmaPresence values across game shards
ProviderAccountsByIdProvider()map of provider IDs and provider accounts

FPragmaFriendOverview #

methodreturns
SocialId()friend’s social ID
DisplayName()friend’s Pragma account display name
PlayerId()friend’s player ID
PlayerIdByGameShard()list of friend’s player IDs across game shards

Events #

There are several friend-related events that player clients can listen to. The following table describes the bindable events relevant to the Friend service.

The following events are handled by the player client.

EventTriggerData returned
OnFriendsListChangedA friend is added or removed from a player’s friend list, or a friend’s presence status changeslist of FPragmaFriend on your friend list
OnFriendUpdatedA friend’s presence status changesFPragmaFriend
OnSentInvitesChangedThe status of a sent invite changeslist of FPragmaFriendOverview for pending sent invites
OnReceivedInvitesChangedThe status of a received invite changeslist of FPragmaFriendOverview for pending received invites
OnBlockedListChangedAn account is added or removed from the player’s blocklistlist of FPragmaFriendOverview for accounts on your blocklist
OnFriendInviteReceivedA player receives an inviteFPragmaFriendOverview
OnFriendInviteAcceptedAn invitee accepts a friend inviteFPragmaFriendOverview
OnFriendInviteDeclinedAn invitee declines a friend inviteFPragmaFriendOverview
OnRemovedAsFriendA player is removed from another player’s friend listFPragmaFriend
OnIncomingFriendInvitesEnabledChangedA player’s ability to receive invites changestrue/false
If notifications from the engine are received out of order due to a network issue, the friend cache will automatically refresh and the ‘On Changed’ events will be broadcasted.