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

# XGameUiShowStateShareAsync

> XGameUiShowStateShareAsync

# XGameUiShowStateShareAsync

*请注意，此方法在 2024 年 6 月 GDK 中处于预览状态。*

此方法会显示一个 UI，其中填充了与所共享状态相关的元数据，并提供了将该状态以网页链接或直接邀请方式共享的 UX 交互控件。

## 语法

```cpp theme={null}
HRESULT XGameUiShowStateShareAsync(
  XAsyncBlock * async,
  XUserHandle requestingUser,
  const char * linkToken
)
```

### 参数

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

指向传递给 [XAsyncRun](/reference/system/xasync/functions/xasyncrun) 的 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) 的指针。

*requestingUser*   \_In\_\
类型：XUserHandle

发送邀请的用户的句柄。

*linkToken*   \_In\_z\_\
类型：const char \*

引用要共享的状态的 linkToken。

## 备注

若要通过 UI 共享状态，游戏在创建状态及对应链接后，应调用 [XGameUiShowStateShareAsync](/reference/system/xgameui/functions/xgameuishowstateshareasync) API，并传入请求用户以及在创建状态链接时获取的链接令牌。使用 PlayFab 是创建状态和链接的一种方式，详情请联系你的 Microsoft 代表。

## 要求

**标头：** XGameUI.h

**库：** xgameruntime.lib

**支持的平台：** Windows、Steam Deck、XBOX One 系列主机和 XBOX Series 主机

## 请参阅

[XGameUI 成员](/reference/system/xgameui/xgameui_members)


## Related topics

- [XGameUiShowStateShareResult](/zh-CN/reference/system/xgameui/functions/xgameuishowstateshareresult.md)
- [XGameUI](/zh-CN/reference/system/xgameui/xgameui_members.md)
- [XGameUiShowAchievementsAsync](/zh-CN/reference/system/xgameui/functions/xgameuishowachievementsasync.md)
- [XGameUiShowWebAuthenticationAsync](/zh-CN/reference/system/xgameui/functions/xgameuishowwebauthenticationasync.md)
- [XGameUiShowErrorDialogAsync](/zh-CN/reference/system/xgameui/functions/xgameuishowerrordialogasync.md)
