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

# Sending game invites using Multiplayer Manager

> How to send XBOX Live game invites with Multiplayer Manager using the platform title-callable UI (TCUI) or a title-implemented custom invite UI.

In a simple multiplayer scenario, a player of your game can play it online with friends. This topic describes the steps for sending invites to another player to join your game.

Initialize Multiplayer Manager and create a lobby session by adding local users. For more information, see [Enable playing a multiplayer game with friends by using Multiplayer Manager](/services/xbox-services/multiplayer/mpm/how-to/live-play-multiplayer-with-friends).
After you receive the [XblMultiplayerEventType](/reference/live/xsapi-c/multiplayer_manager_c/enums/xblmultiplayereventtype)`::UserAdded` event, you can start sending invites.

An invite can be sent in two ways.

* [XBOX platform invite title-callable UI (TCUI)](#xbox-platform-invite-tcui)
* [Title-implemented custom UI](#title-implemented-custom-ui)

For more information about the process, see [Sending invites to another player (flowchart)](/services/xbox-services/multiplayer/mpm/concepts/flowcharts/live-mpm-send-invites).

### XBOX platform invite TCUI <a id="xbox-platform-invite-tcui" />

Call [XblMultiplayerManagerLobbySessionInviteFriends](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessioninvitefriends) to display the standard XBOX UI where the player can select friends or recent players to invite to the game.
When the player confirms their selection, Multiplayer Manager sends the invites to the selected players.

#### Flat C API

```cpp theme={null}
std::string customActivationContext = "{ \"customGameData\": 1 }"; // This string can be anything your game sends across to the invited player's game.

HRESULT hr = XblMultiplayerManagerLobbySessionInviteFriends(xuserHandle, nullptr, customActivationContext.c_str());
```

Multiplayer Manager performs the following functions to invite players by using the XBOX platform invite TCUI.

* Displays the XBOX standard TCUI.
* Sends invite directly to the selected players.

### Title-implemented custom UI<a id="title-implemented-custom-ui" />

Your title can implement a custom TCUI for viewing online friends and inviting them.
Games can use the [XblMultiplayerManagerLobbySessionInviteUsers](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagerlobbysessioninviteusers) method to send invites to a set of people defined by their XBOX Live User IDs.
This is useful if you use your own in-game UI instead of the standard XBOX UI.

#### Flat C API

```cpp theme={null}
size_t xuidsCount = 1;
uint64_t xuids[1] = {};
xuids[0] = 1234567891234567;
HRESULT hr = XblMultiplayerManagerLobbySessionInviteUsers(
    xblUserHandle, 
    xuids, 
    xuidsCount, 
    nullptr,    // ContextStringId 
    nullptr     // CustomActivationContext
);
```

When using a title-implemented custom UI, Multiplayer Manager sends an invite directly to selected players.


## Related topics

- [Sending invites](/services/xbox-services/multiplayer/invites/how-to/live-invites-send.md)
- [Invites overview](/services/xbox-services/multiplayer/invites/live-multiplayer-invites-overview.md)
- [Invite players to game sessions](/services/xbox-services/multiplayer/invites/live-invites-nav.md)
- [Multiplayer Manager overview](/services/xbox-services/multiplayer/mpm/live-multiplayer-manager-overview.md)
- [Sending invites to another player (flowchart)](/services/xbox-services/multiplayer/mpm/concepts/flowcharts/live-mpm-send-invites.md)
