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

# XblMultiplayerActivitySendInvitesAsync

> XblMultiplayerActivitySendInvitesAsync

# XblMultiplayerActivitySendInvitesAsync

向 XBOX 用户 ID 发送邀请以加入调用方的当前活动。

## 语法

```cpp theme={null}
HRESULT XblMultiplayerActivitySendInvitesAsync(  
         XblContextHandle xblContext,  
         const uint64_t* xuids,  
         size_t xuidsCount,  
         bool allowCrossPlatformJoin,  
         const char* connectionString,  
         XAsyncBlock* async  
)  
```

### 参数

*xblContext*   \_In\_\
类型：[XblContextHandle](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

本地用户的 XBOX Live 上下文。

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

要邀请的 XBOX 用户 ID 列表。

*xuidsCount*   \_In\_\
类型：size\_t

`xuids` 数组的大小。

*allowCrossPlatformJoin*   \_In\_\
类型：bool

如果标题配置了跨平台邀请，将此参数设置为 true 会将邀请发送到标题支持的所有平台端点。如果设置为 false，则仅将邀请发送到发送方的平台。如果未配置跨平台邀请，则始终仅将邀请发送到发送方的平台。

*connectionString*   \_In\_opt\_z\_\
类型：char\*

（可选）对等方用于加入游戏的连接字符串。

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

此操作的 `XAsyncBlock`。

### 返回值

类型：HRESULT

此 API 操作的 HRESULT 返回代码。

## 备注

若要获取异步操作的结果，请在 `XAsyncBlock` 回调内或 `XAsyncBlock` 完成后调用 [XAsyncGetStatus](/reference/system/xasync/functions/xasyncgetstatus)。<br /><br /> 若要了解如何使用此函数，请参阅[多人游戏活动的示例代码](/services/xbox-services/multiplayer/mpa/how-to/live-mpa-client-how-to)的[邀请](/services/xbox-services/multiplayer/mpa/how-to/live-mpa-client-how-to#invites)部分中的“发送邀请”。<br /><br /> 有关多人游戏活动的详细信息，请参阅[活动](/services/xbox-services/multiplayer/mpa/concepts/live-mpa-activities)。

## REST 调用

调用 POST /titles/{titleId}/invites

## 要求

**头文件：** multiplayer\_activity\_c.h

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

## 另请参阅

[multiplayer\_activity\_c](/reference/live/xsapi-c/multiplayer_activity_c/multiplayer_activity_c_members)


## Related topics

- [从 MPSD 迁移到 PlayFab Multiplayer 和 MPA](/zh-CN/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
- [Multiplayer Activity 示例代码](/zh-CN/services/xbox-services/multiplayer/mpa/how-to/live-mpa-client-how-to.md)
- [XblMultiplayerSendInvitesAsync](/zh-CN/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersendinvitesasync.md)
- [XblMultiplayerSendInvitesResult](/zh-CN/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersendinvitesresult.md)
- [XblMultiplayerActivityInviteHandler](/zh-CN/reference/live/xsapi-c/multiplayer_activity_c/functions/xblmultiplayeractivityinvitehandler.md)
