Hi,
I just noticed in the docs that the GetInventoryAsync method states that it requires an AddInventoryItemOptions object. The code samples correctly reference the GetInventoryOptions object.
https://docs.unity.com/economy/SDK-player-inventory.htm?tocpath=Economy SDK guide|Player inventory|_____1#GetInventory
Also the code samples make reference to the GetNext() method. This doesn’t exist, it should be GetNextAsync().
Additionally, with regard to paging the data would it be better to show a while loop with the HasNext/GetNext commands rather than an if statement which will only get the next page, instead of iterating through all that remain?
PlayerInventory.GetInventoryOptions options = new PlayerInventory.GetInventoryOptions
{
ItemsPerFetch = 5
};
GetInventoryResult inventoryResult = await Economy.PlayerInventory.GetInventoryAsync(options);
List<PlayersInventoryItem> listOfItems = inventoryResult.PlayersInventoryItems;
//use while to iterate through remaining pages
while (inventoryResult.HasNext) {
GetInventoryResult nextinventoryResult = await inventoryResult.GetNextAsync(5);
//Do something with the newly retrieved pages
}