Hi there,
I am seeking to get my inventory, especially my virtual currency for my players, I am struggling to find the error or the right solution.
Each time, I run my app it does not give me the right result.
I am working on a UWP for Windows 10.
In my mainpage I call the method UpdateCurrency to display the values for each currency without any success.
public static int Coins { get { return _coins; } }
private static int _coins; public static int Lives { get { return _lives; } }
private static int _lives;
public async static void UpdateCurrency()
{ var coins = await PlayFabClientAPI.GetUserInventoryAsync(new GetUserInventoryRequest);
if (coins.Result.VirtualCurrency.ContainsKey("CO"))
{
_coins = coins.Result.VirtualCurrency["CO"];
} if (coins.Result.VirtualCurrency.ContainsKey("LV"))
{
_lives = coins.Result.VirtualCurrency["LV"];
} }
Hopefully you could help me with that.
Many thanks in advance,
Best wishes,
Michael