question

Frank Ohlhof avatar image
Frank Ohlhof asked

How to get the Display Name?

Hello,

I would like to know to get the DisplayName of a User so show it on the loading screen before a Multiplayer Game.

All I can find is how to get the Username, but that won´t do it, because it has no capital letters.

I work in C# with Unity. Thx

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The Title Display Name is returned in the UserTitleInfo object, in the UserAccountInfo. You can retrieve this via a call to https://api.playfab.com/Documentation/Client/method/GetAccountInfo on the client.

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

pdaz avatar image pdaz commented ·

Why don't you add the same server function? I'd like to retrieve names from the list of players.

0 Likes 0 ·
brendan avatar image brendan pdaz commented ·

Actually, we do have that - https://api.playfab.com/Documentation/Server/method/GetUserAccountInfo. So you can use it now to get the info on other players in a multiplayer session, no problem (as in the original question). Note, however, that using it to get additional player info for a leaderboard isn't really valid, as that would generate an excessive number of calls (N leaderboard entries, times every player in the game querying leaderboards). We'll be making the player profile info available in leaderboard queries shortly.

0 Likes 0 ·
Thomas Brown avatar image Thomas Brown commented ·

Is there any reason in particular why the user displayName is not returned on Login? It would be really nice to only have to do one query to get that information.

Thanks in advance!

0 Likes 0 ·
brendan avatar image brendan Thomas Brown commented ·

You can get the player's Title Display Name on any login call by setting ShowDisplayName to true in the ProfileConstraints member of the InfoRequestParameters.

0 Likes 0 ·
Thomas Brown avatar image Thomas Brown commented ·

Ah awesome! Thanks for that :)

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.