Skip to main content
This topic provides example code for setting a user’s online Presence status. XBOX services Rich Presence provides features for advertising a player’s current activity to other players. For more information, see Rich Presence overview.

Updating a user’s online Presence status

This example code sets a user’s online Presence status. The following example uses the flat C API.
For more information, see the following:

Updating Rich Presence status

The following example sets the playingMap Rich Presence string for the user. In this example, playingMap is configured as a static string that has no tokens. xboxLiveContext is the XblContextHandle for the user, and queue is your game’s task queue, or nullptr to use the process default task queue.
If the configured presence string requires explicit replacement strings, set presenceTokenIds to their configured string IDs in placeholder order, and set presenceTokenIdsCount to the array length. If the scid or presenceId member is empty, the request includes only the active or inactive state and doesn’t include a Rich Presence string. For more information, see the following:

Rate limits and certification

The Presence service allows each user and title 3 writes in 15 seconds and 30 writes in 300 seconds. Update Rich Presence when the player’s activity changes, and combine rapid changes into a single update. If you also refresh Rich Presence periodically, keep the combined rate within both limits. If a call fails with HTTP_E_STATUS_429_TOO_MANY_REQUESTS (XblErrorCondition::Http429TooManyRequests), don’t retry in a loop. The service response includes a Retry-After header, and XSAPI honors it. Certification test XR-132 fails a title whose request rate is at or above 10 times the sustain limit, which is 300 Presence writes in 300 seconds. This threshold isn’t a safe operating allowance. For more information, see Fine-grained rate limiting.
Last modified on October 29, 2026