Skip to content

Using Rich Presence in Game

This how-to uses Rich Presence to send player status changes from your game.

Prerequisites

Rich Presence

Rich Presence doesn't require any additional setup in the SDK.

Sending Status Changes

When sending a state change for a player, provide:

  • A status name, e.g. main_menu, level_1, settings_menu.
  • Metadata (optional), e.g. build_version, game_fps_count.

Sending a Presence status is as simple as calling a function.

// Example code of a function being called when the player enters a Game Over state
public void SendGameOverPresenceStatus()
{
Dictionary<string, string> presenceDetails = new Dictionary<string, string>()
{
{"device", SystemInfo.deviceModel },
{"unity_version", Application.unityVersion}
};
LootLockerPresenceManager.UpdatePresenceStatus("game_over", presenceDetails);
}

Out of Focus / Pause Behavior

When Auto Connect and Disconnect On Pause are enabled, Presence reconnects and resends the last status that was sent when Presence reconnects.

Conclusion

You've used Rich Presence to send a change of game status. To learn how to interpret this information, continue to View Presence in Web Console.