Hello,
I would like to get the DisplayNames of all players in a Match.
I am doing matchmaking via PlayFabMultiplayerAPI.GetMatch.
When I get the result, I can access all the members in the match. Every member has its Entity.
When I call PlayFabProfilesAPI.GetProfile with an entity, I get error "NotAuthorized". I am authenticated in the game with PlayFab account using PlayFabClientAPI.LoginWithPlayFab.
Am I doing something wrong or can I enable this in the Game Manager?
The code if it helps: https://monosnap.com/file/tHgOb0kFwkTcgBu3s0IFSkyaSIgWgb
Answer by jital · May 15, 2019 at 04:41 PM
Hello,
Can you check inside your Game Manager, go to Settings->Client Profile Options, and verify the "Display Name" is checked under "Allow Client Access to Profile Properties".
Yes, it is indeed checked.
I tried to run the code with all the access permissions checked, still getting "NotAuthorized" error.
I tried to reproduce your issue using the PlayFabProfilesAPI.GetProfile call, but I did not get the same error, I received null.
Is there a specific reason you need to use PlayFabProfilesAPI.GetProfile? Can you trying using PlayFabClientAPI.GetPlayerProfile instead?
I believe the issue lies somewhere in manually creating and editing the Entity Key. I will look more into this to see if I am correct.
To call PlayFabClientAPI.GetPlayerProfile I need PlayfabId. The GetMatch call returns GetMatchResult and in that structure, I get match members with EntityKeys and not PlayfabIds. Is there an API to convert EntityKey to PlayfabId if the entity is player?
As you said, its probably the manual creation of EntityKey, but Im not sure how else to get DisplayNames in a match.