question

arnesso avatar image
arnesso asked

How to get Display Name by e-mail(Unity) ?

I have tried to get playfab display name from GetAccounInfo , if I know e-mail, but I did not find the solution.
Is that possible to get display name , if i know only e-mail and password ?

I would like to use for auto login.. if user login with email, then the game shows the correct name.
Thank you for your help

Player Dataunity3dAuthentication
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

·
Citrus Yan avatar image
Citrus Yan answered

You can specify which part of the player profile you want to retrieve in the login API calls. In your case, you probably use LoginWithEmailAddress, here is sample request that can do such things so that you can show the correct name for the player upon login:

{ 
"Email": "xxx", 
"Password": "xxx", 
"TitleId": "{
                {TitleId}}", 
"InfoRequestParameters": { 
"GetPlayerProfile": true,
"ProfileConstraints": { 
"ShowDisplayName": true 
	}  
    }
}

PS: You can specify which pieces of the info such as UserData, Inventory, Statistics, etc. to return for the players upon login with the "InfoRequestParameters" property so that later you don't have to make additional calls to do that, please navigate to this section to learn more: https://docs.microsoft.com/en-us/rest/api/playfab/client/authentication/loginwithemailaddress?view=playfab-rest#getplayercombinedinforequestparams

10 |1200

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

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.