Skip to main content

Put it all together - Playing with Friends - (Unity module)

Last updated on July 28, 2025

Connect the generated button callback to send invitation

Open the InviteToSessionButton_Starter class, locate the InviteToSession() function, and add the highlighted code below. This code triggers the invite request you implemented in the previous step.

public void InviteToSession()
{
// ...
if (targetPlayerId.IsNullOrEmpty())
{
BytewarsLogger.LogWarning("Current menu is not friend details or friend details starter menu.");
return;
}

playingWithFriendswrapper.SendInviteToCurrentGameSession(targetPlayerId, null);
}

Resources