Entitlement In-game Implementation
Get Single Entitlement
When getting a single entitlement, you can use the Status field to check where the purchase is in it's current stage.
- canceled means that the purchase was canceled either by the player or an issue was encountered.
- pending means that the purchase is currently still being processed, at this time it would be smart to invoke the method again to check for updates. It would also be a good idea to limit number or rate of attempts to avoid spamming the function.
- active means that the purcahse has completed.
string entitlementID = "";LootLockerSDKManager.GetSingleEntitlementHistory(entitlementID, (response)=>{ if(!reponse.success) { Debug.Log(response.errorData.ToString()); return; }
if(response.Status == LootLockerEntitlementHistoryListingStatus.canceled) { //canceled or issue encountered. Debug.Log(response.errorData.ToString()); return; }
if(response.Status == LootLockerEntitlementHistoryListingStatus.pending) { //retry the process }
if(response.Status == LootLockerSDKManager.GetSingleEntitlementHistory.active) { //Purchase successful, handle the expected outcome. }});
curl --location --request GET 'https://api.lootlocker.io/game/entitlements/{entitlement_id}' \--header 'x-session-token: {{session_token}}' \--header 'Content-Type: application/json' \List Entitlements
Each entitlement in the response has multiple entries of information, such as Type, Store, and the Rewards and Items which were given to the player.
int count = 10;string after = "";LootLockerSDKManager.ListEntitlements(count,after,(response) => { if (!response.success) { Debug.Log("Could not get entitlements"); return; } //Handle entitlement list});
curl --location --request GET 'https://api.lootlocker.io/game/entitlements/' \--header 'x-session-token: {{session_token}}' \--header 'Content-Type: application/json' \