xboxLiveContext is the XblContextHandle for the signed-in user, state holds your title’s state, and LogToFile is a logging function that your title defines.
Subscribing to relationship changes
You don’t need to subscribe to relationship changes separately. The XBOX Services API (XSAPI) creates or reuses one social Real-Time Activity (RTA) subscription for the context. Relationship-changed handlers and incoming friend request count handlers share it. XSAPI removes the subscription only after you remove all handlers of both types.XblSocialSubscribeToSocialRelationshipChange and XblSocialUnsubscribeFromSocialRelationshipChange are deprecated and don’t manage the RTA subscription. Remove calls to them from your code as a pair. If your code already created a subscription handle with XblSocialSubscribeToSocialRelationshipChange, release it by calling XblSocialUnsubscribeFromSocialRelationshipChange.