Skip to main content
Sets presence info for the current user context.

Syntax

Parameters

xblContextHandle   _In_
Type: XblContextHandle
XBOX services context for the local user. isUserActiveInTitle   _In_
Type: bool
Indicates if the current user context is currently active or inactive in the title. The application can choose to set this based on an amount of inactivity. richPresenceIds   _In_opt_
Type: XblPresenceRichPresenceIds*
Optional pointer to struct which controls the rich presence strings. async   _In_
Type: XAsyncBlock*
The AsyncBlock for this operation.

Return value

Type: HRESULT HRESULT return code for this API operation. Possible error codes include the following. This list isn’t exhaustive.

Remarks

To get the result of the service call, call XAsyncGetStatus inside the AsyncBlock callback or after the AsyncBlock is complete. To choose how to handle a failed result, pass it to XblGetErrorCondition. For example, XblErrorCondition::Network indicates a network connectivity problem, XblErrorCondition::Auth indicates an authentication problem, and XblErrorCondition::Http429TooManyRequests indicates that the title called the Presence service too often. Call this function when the player’s activity changes. The Presence service limits how often each user and title can write presence. For more information, see Fine-grained rate limiting. If richPresenceIds isn’t null but its scid or presenceId member is empty, the request includes only the active or inactive state and doesn’t include a Rich Presence string. For an example, see Updating a user’s Presence via XSAPI C.

Requirements

Header: presence_c.h Library: Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

See also

presence_c
Last modified on October 29, 2026