how can i get user's displayname??
or boolean if displayname setted.
how can i get user's displayname??
or boolean if displayname setted.
From the client: https://api.playfab.com/Documentation/Client/method/GetAccountInfo
From Cloud Script or a custom game server: https://api.playfab.com/Documentation/Server/method/GetUserAccountInfo
The DisplayName is part of the UserTitleInfo in the response.
Thanks for quick reply!!
I'm trying to check if user's displayname is setted on login and pop up the setting menu.
so.. no possible ways to get name from loginresult?
All login API calls include InfoRequestParameters, which lets you request available information for the player account, including the Account Info you can query from GetAccountInfo. So if your requirement is to get the info at login time, that would be the way to go.
I kept trying with the code above. unfortunately , giving nullexception error
inside login result callback
print("playfab ID = " + result.PlayFabId); if (result.InfoResultPayload.AccountInfo.TitleInfo.DisplayName == "") { print("Should SetDisplay Name"); }
result.InfoResultPayload.AccountInfo.TitleInfo.DisplayName
is giving me nullreferenceexception error...
What are you passing in for the InfoRequestParameters input to the call? Also, are you sure that the player in question has logged into the specific Title ID? It's always a good idea to check objects before dereferencing them, and to handle cases where they are null. For example, if the player has never logged into the specific Title ID in question, there will be no TitleInfo for that player, making that part of the returned data null. Alternately, if the InfoRequestParameters didn't have GetUserAccountInfo set to true, no AccountInfo would be returned, making it null.
2 People are following this question.