Skip to main content
Registers an event handler for notifications of social relationship changes caused by the registering user.

Syntax

Parameters

xboxLiveContext   _In_
Type: XblContextHandle
An XBOX services context handle created with XblContextCreateHandle. handler   _In_
Type: XblSocialRelationshipChangedHandler
The callback function that receives notifications. handlerContext   _In_opt_
Type: void*
Client context pointer to be passed back to the handler.

Return value

Type: XblFunctionContext An XblFunctionContext used to remove the handler. Returns 0 and doesn’t register a handler if xboxLiveContext or handler is null.

Remarks

This handler triggers only if the user changes the relationship with another user. It doesn’t trigger if another user changes the relationship with the user. You don’t need to subscribe to social relationship changes separately. When you register a handler, the XBOX Services API (XSAPI) creates a Real-Time Activity (RTA) subscription to social relationship notifications for the context’s user, or reuses the existing one. Social relationship changed handlers and friend request count handlers share this subscription. XSAPI removes the subscription only after you remove all handlers of both types for the context. This handler doesn’t receive changes to the number of incoming friend requests. To receive them, call XblSocialAddFriendRequestCountChangedHandler. Call XblSocialRemoveSocialRelationshipChangedHandler to unregister the event handler.

Requirements

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

See also

social_c
Last modified on October 29, 2026