xboxLiveContext is an XblContextHandle for the signed-in local user, state is a title-defined object that stores the handler token, and LogToFile is a title-defined logging function. Replace 123 with the XBOX user ID (XUID) of a user whose Presence you want to track, and replace otherTitleId with the title ID of another title that you want to track.
XblPresenceSubscribeToTitlePresenceChange and XblPresenceUnsubscribeFromTitlePresenceChange are deprecated. Don’t use them in new code. XSAPI manages the Real-Time Activity (RTA) subscriptions for you when you track users with XblPresenceTrackUsers and titles with XblPresenceTrackAdditionalTitles.Adding a title Presence change handler
Register the handler before you track users and titles. The function returns 0 if xblContextHandle or handler is null.Tracking users and titles
Title Presence change handlers receive notifications only for the users that you track withXblPresenceTrackUsers and the titles that you track. The current title is tracked by default, so call XblPresenceTrackAdditionalTitles only for other titles. Each call adds to the existing list. Check the result of each call.
Stopping tracking users and titles
When you no longer need title Presence updates, stop tracking the titles and users that you tracked, and check each result.XblPresenceStopTrackingAdditionalTitles doesn’t stop tracking the current title.
Removing a title Presence change handler
Remove the handler by passing the token thatXblPresenceAddTitlePresenceChangedHandler returned. Clear the stored token only after the call succeeds.
