> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# real_time_activity_c (contents)

> real_time_activity_c

## Functions

| Function | Description |
| - | - |
| [XblRealTimeActivityAddConnectionStateChangeHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityaddconnectionstatechangehandler.md) | Registers a handler function to receive a notification that is sent when the client service loses or gains connectivity to the Real-Time Activity (RTA) service. |
| [XblRealTimeActivityAddResyncHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityaddresynchandler.md) | Registers a handler function to receive a notification that is sent when there is a resync message from the RTA service. |
| [XblRealTimeActivityConnectionStateChangeHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityconnectionstatechangehandler.md) | Handler function for when the client service loses or gains connectivity to the RTA service. |
| [XblRealTimeActivityRemoveConnectionStateChangeHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityremoveconnectionstatechangehandler.md) | Unregisters an event handler for RTA service connectivity state changes. |
| [XblRealTimeActivityRemoveResyncHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityremoveresynchandler.md) | Unregisters an event handler for RTA service resync notifications. |
| [XblRealTimeActivityResyncHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityresynchandler.md) | Handler function for when there is a resync message from the RTA service. |
| [XblRealTimeActivitySubscriptionErrorHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivitysubscriptionerrorhandler.md) | Deprecated. XSAPI no longer invokes this callback. |

## Handles

| Handle | Description |
| - | - |
| [XblRealTimeActivitySubscriptionHandle](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/handles/xblrealtimeactivitysubscriptionhandle.md) | Subscription handle. |

## Enumerations

| Enumeration | Description |
| - | - |
| [XblRealTimeActivityConnectionState](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/enums/xblrealtimeactivityconnectionstate.md) | Enumeration for the possible connection states of the connection to the RTA service. |
| [XblRealTimeActivitySubscriptionState](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/enums/xblrealtimeactivitysubscriptionstate.md) | Enumeration for the possible states of a statistic subscription request to the RTA service. |

## Deprecated functions

The following functions are declared in `real_time_activity_c.h` but are deprecated. Don't call them in new code. The XBOX services API (XSAPI) manages the Real-Time Activity (RTA) service connection for you and handles RTA service errors internally.

| Function | Current behavior | What to do instead |
| - | - | - |
| `XblRealTimeActivityActivate` | Adds a legacy activation for the user and tries to establish the RTA service connection. Returns `S_OK`. | Don't call it. XSAPI connects automatically when you register handlers and track items that use RTA. |
| `XblRealTimeActivityDeactivate` | Removes a legacy activation for the user. When no activations remain, XSAPI might close the connection and call connection state change handlers with `XblRealTimeActivityConnectionState::Disconnected`. | Don't call it. XSAPI closes the connection when it's no longer needed. |
| `XblRealTimeActivityAddSubscriptionErrorHandler` | Does nothing. XSAPI never calls the handler. | Don't register a handler. |
| `XblRealTimeActivityRemoveSubscriptionErrorHandler` | Does nothing and returns `S_OK`. | Remove the call. |
| `XblRealTimeActivitySubscriptionGetState` | On success, writes `XblRealTimeActivitySubscriptionState::Unknown` to *state* and returns `S_OK`. | Don't rely on subscription state. |
| `XblRealTimeActivitySubscriptionGetId` | On success, writes a client-side ID that isn't related to the ID that the RTA service assigns to *id* and returns `S_OK`. | Don't rely on subscription IDs. |


## Related topics

- [XblRealTimeActivityResyncHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityresynchandler.md)
- [XblRealTimeActivitySubscriptionHandle](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/handles/xblrealtimeactivitysubscriptionhandle.md)
- [XblRealTimeActivityConnectionState](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/enums/xblrealtimeactivityconnectionstate.md)
- [XblRealTimeActivitySubscriptionState](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/enums/xblrealtimeactivitysubscriptionstate.md)
- [XblRealTimeActivityAddResyncHandler](https://docs.xbox.com/reference/live/xsapi-c/real_time_activity_c/functions/xblrealtimeactivityaddresynchandler.md)
