Reject a Party Invitation
Last updated on
When a player has been invited to a party, they can choose to reject the invitation. Party invitees will receive a notification that they've rejected the invitation and current party members will also receive a notification that someone has rejected the party invitation.
- Unreal Engine
- Unity
FRegistry::Lobby.Connect();
FRegistry::Lobby.SetInvitePartyRejectResponseDelegate(AccelByte::Api::Lobby::FPartyRejectResponse::CreateLambda([](const FAccelByteModelsPartyRejectResponse& Result)
{
if (Result.Code == "0")
{
// Do something if InvitePartyRejectResponseDelegate has been successful
}
else
{
// Do something if InvitePartyRejectResponseDelegate has an error
}
}));
FString PartyId = FString("SomePartyId");
FString InvitationToken = FString("SomeInvitationToken");
FRegistry::Lobby.SendRejectInvitationRequest(PartyId, InvitationToken);
string partyId = "SomePartyId";
string invitationToken = "SomeInvitationToken";
AccelBytePlugin.GetLobby().Connect();
AccelBytePlugin.GetLobby().RejectPartyInvitation(partyId, invitationToken, result =>
{
if (result.IsError)
{
// Do something if RejectPartyInvitation has an error
Debug.Log($"Error RejectPartyInvitation, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
}
else
{
// Do something if RejectPartyInvitation has been successful
}
});