Skip to main content
EOS Interfaces

Entitlements

warning

Requires EOSCore 2.2.0 and later.

The Online Subsystem implements IOnlineEntitlements with EOS Ecom. An entitlement is something the player owns on the Epic Games Store, for example the game or a DLC.

Use it through the Online Subsystem with GetEntitlementsInterface(). There are no Blueprint nodes for the Entitlements interface. In Blueprint, use EOS_Ecom_QueryEntitlements and the other Ecom functions, see Ecom.

Requirements​

  • The player is logged in with an Epic Account (Auth interface). A Connect login alone is not enough, QueryEntitlements then fails with Entitlements need a user logged in with an Epic account.
  • Your product is set up for the Epic Games Store, with catalog items and offers in the Developer Portal.

Functions​

Entitlements functionEOS functionCallback
QueryEntitlementsEOS_Ecom_QueryEntitlements, redeemed entitlements includedOnQueryEntitlementsComplete
GetAllEntitlementsReads the entitlements from the last queryNone
GetEntitlementFinds an entitlement by its entitlement idNone
GetItemEntitlementFinds an entitlement by its catalog item idNone

Namespace in QueryEntitlements is passed to EOS as the catalog namespace override. Leave it empty to use the catalog of your sandbox. GetAllEntitlements with a namespace only returns the entitlements queried with that namespace. An empty namespace returns all of them.

Each FOnlineEntitlement has:

FieldValue
IdEntitlement id
NameEntitlement name
ItemIdCatalog item id
NamespaceThe namespace used in the query
StatusActive, or Redeemed for a redeemed entitlement
ConsumedCount1 when redeemed, otherwise 0
EndDateISO 8601 date when the entitlement ends. Empty if it does not end

Example​

#include "OnlineSubsystem.h"
#include "OnlineSubsystemUtils.h"
#include "Interfaces/OnlineEntitlementsInterface.h"
#include "Interfaces/OnlineIdentityInterface.h"

void AMyPlayerController::CheckDLC()
{
IOnlineSubsystem* Subsystem = Online::GetSubsystem(GetWorld(), TEXT("EOSCore"));
IOnlineEntitlementsPtr Entitlements = Subsystem ? Subsystem->GetEntitlementsInterface() : nullptr;
FUniqueNetIdPtr UserId = Subsystem ? Subsystem->GetIdentityInterface()->GetUniquePlayerId(0) : nullptr;
if (!Entitlements.IsValid() || !UserId.IsValid())
{
return;
}

Entitlements->AddOnQueryEntitlementsCompleteDelegate_Handle(FOnQueryEntitlementsCompleteDelegate::CreateUObject(this, &AMyPlayerController::OnQueryEntitlementsComplete));
Entitlements->QueryEntitlements(*UserId, FString());
}

void AMyPlayerController::OnQueryEntitlementsComplete(bool bWasSuccessful, const FUniqueNetId& UserId, const FString& Namespace, const FString& Error)
{
IOnlineEntitlementsPtr Entitlements = Online::GetSubsystem(GetWorld(), TEXT("EOSCore"))->GetEntitlementsInterface();

if (bWasSuccessful && Entitlements->GetItemEntitlement(UserId, TEXT("<catalog item id of the DLC>")).IsValid())
{
// The player owns the DLC
}
}

Limits​

  • Page in QueryEntitlements is ignored. All entitlements are returned.
  • bIsConsumable is always false. Use EOS_Ecom_RedeemEntitlements to redeem consumable entitlements.