> ## 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.

# XblPresenceGetPresenceAsync

> XblPresenceGetPresenceAsync

# XblPresenceGetPresenceAsync

获取特定 XBOX 用户 ID 的在线状态信息。

## 语法

```cpp theme={null}
HRESULT XblPresenceGetPresenceAsync(  
         XblContextHandle xblContextHandle,  
         uint64_t xuid,  
         XAsyncBlock* async  
)  
```

### 参数

*xblContextHandle*   \_In\_\
类型：[XblContextHandle](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/types_c/handles/xblcontexthandle.md)

本地用户的 XBOX Live 上下文。

*xuid*   \_In\_\
类型：uint64\_t

要获取在线状态的用户的 XBOX 用户 ID。

*async*   \_In\_\
类型：XAsyncBlock\*

此操作的 AsyncBlock。

### 返回值

类型：HRESULT

此 API 操作的 HRESULT 返回代码。

## 要求

**头文件：** presence\_c.h

**库：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另请参阅

[presence\_c](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/presence_c/presence_c_members.md)


## Related topics

- [XblPresenceGetPresenceResult](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/presence_c/functions/xblpresencegetpresenceresult.md)
- [presence_c](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/presence_c/presence_c_members.md)
- [获取用户的在线状态](https://docs.xbox.com/zh-CN/services/xbox-services/community/presence/how-to/live-getting-a-users-presence.md)
- [可选服务](https://docs.xbox.com/zh-CN/build/gdk-and-engines/optional-services.md)
- [通过 REST 更新用户的在线状态](https://docs.xbox.com/zh-CN/services/xbox-services/community/presence/how-to/live-updating-presence-rest.md)
