I'm using PlayFabClientAPI.GetUserData with the logged in user's PlayFabID but the result I get in return is an empty GetUserDataResult object.
Am I missing something in the request? PlayFabPlayerId holds the correct ID, I made sure of it.
PlayFabClientAPI.GetUserData(new GetUserDataRequest { PlayFabId = PlayFabLogin.PlayFabPlayerId }, OnGetUserData, OnPlayFabError);
Answer by Sarah Zhang · Jan 13 at 02:50 AM
Do you mean this client API GetUserData returned successfully and the Data object in this response is empty? Or this API returned an error? If you got the API result successfully, but the Data object the API returned is empty, it means this player doesn’t own the Player Data K/V pair. You can check the documentation - Quickstart Player Data - PlayFab | Microsoft Docs to set the player data in the Game Manager or set the player data through the API call, then try to get the player data again.
If there is an error message, could you please provide it for our reference?
Besides, for clarification, to call the client API GetUserData to get the caller’s Player Data, you needn’t to pass the PlayFabId in the request body. The client API GetUserData will identify the player based on the SessionTicket in the request header. If you identify the other player’s PlayFabId in the request body, the API will only return the publicK/V pairs of that player. So, if you would like to retrieve the Player Data of the caller, you can also try to call the API GetUserData without providing the PlayFabId.
When I call WriteTitleEvent with Body parameter using the C# client, the Body is lost 1 Answer
Alternatives to Action Trigger Due to Limit 1 Answer
Sending Emails not Working using smtp 1 Answer
What is exact limit of WritePlayerEvent API? 1 Answer
VM Unassignment Started events blowing up today - why? 1 Answer