Presence SDK Reference #

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

Presence SDK #

The table below contains a list of the SDK methods relevant to the presence feature. These methods are available via the PresenceApi.

Calldescription
Initialize()Initializes the Presence API. Required to use the Presence SDK functions.
SetAsOnline()Appears as “online” to friends in the game instance
SetAsAway()Appears as “away” to friends in the game instance
SetRichPresence()Sets rich presence
SetPresence()Sets basic presence and rich presence at the same time
GetPresenceCache()Retrieves presence status for current player
ForceSync()Forcibly synchronizes the player client PresenceApi with the presence information in the Pragma Engine backend

Unreal classes #

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

FPragmaPresence #

methodreturns
GetPlayerId()player’s ID
GetGameShardId()game shard’s ID
GetGameTitleId()game title’s ID
GetBasicPresence()EBasicPresence (Unknown, Online, or Away)
GetExt()FPragma_Presence_ExtRichPresence
GetVersion()Presence service version

IPragmaPresenceCache #

methodreturns
HasPresence()true/false
GetPresence()FPragmaPresence

Events #

The following events are related to the Presence feature.

To optimize server-load management, Pragma engine only sends Presence-related events to friends who are online.

EventTriggerData returned
OnPresenceChangedYour presence status changesthe updated FPragmaPresence