I have a very simple Unity project that logs in a player with a CustomID and then tries to fetch virtual currency balance. I also have a virtual currency ("CC") set up with an initial deposit of 100.
When logging in a user, I'm running the following code (simplified for brevity):
var request = new LoginWithCustomIDRequest { CustomId = CustomId, CreateAccount = true, InfoRequestParameters = new GetPlayerCombinedInfoRequestParams { GetUserVirtualCurrency = true } }; PlayFabClientAPI.LoginWithCustomID(request, (result) => { Debug.Log(JsonUtility.ToJson(result)); }, (error) { /* handled properly in real code */ });
The login result object being logged to the console does not contain the virtual currency balance, despite it being specified in the request. Similarly, making a GetUserInventory API call also does not return my virtual currency balance (although if I manually assign that user an inventory item, that item does show up in the response). If I look up that user in the PlayFab dashboard, they do in fact have a CC balance of 100 in the "Virtual Currency" tab for their account.
After I turned on client access to add/subtract virtual currency values, I have been able to successfully make AddUserVirtualCurrency calls that do in fact modify the user's CC balance. The responses to those requests reflect the correct balance given all of the previous AddUserVirtualCurrency calls I have made. e.g. for a user I've made three calls to add 5 CC to their account, the response to the third call correctly listed the new balance as 115 CC. Despite that, continued GetUserInventory calls (and login calls with the correct parameter set) continue to not return VC balance data.
Is there any reason my login and GetUserInventory calls wouldn't be returning my virtual currency balance, despite explicitly asking for it and that player having a VC balance?
Thanks!