Make IAP Purchases In-Game
Prerequisites
Initiate Purchase In-Game
Validate Purchase with LootLocker
LootLockerSDKManager.RedeemEpicStorePurchaseForPlayer(
accountId: epicAccountId,
bearerToken: epicBearerToken,
entitlementIds: epicEntitlementIds,
sandboxId: epicSandboxId,
onComplete: (response) =>
{
if (response.success)
{
Debug.Log("Purchase validated and rewards granted!");
// Refresh player data to see the granted rewards
LootLockerSDKManager.GetPlayerData((playerResponse) =>
{
if (playerResponse.success)
{
Debug.Log("Player data updated with new rewards");
}
});
}
else
{
Debug.LogError("Failed to validate purchase: " + response.errorData.message);
}
}
);Grant Rewards to a Player
Grant Rewards to a Class
Handle Edge Cases
Conclusion
Last updated
Was this helpful?
