question

A A avatar image
A A asked

Login with E-Mail or Username?

Hello everyone,

is there a way to login with E-Mail or Username. I know there is LoginWithPlayFab or LoginWithEmailAdress but I am searching for a method that contains both at the same time. I mean that PlayFab recognizes either the username or the E-Mail from an Input Field, so I can say: Enter the Email or Username to login.

Thank you already in advance for your answer.

apisunity3dsdks
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

·
JayZuo avatar image
JayZuo answered

PlayFab does not have such a method built-in. However, you can achieve this by combining LoginWithPlayFab and LoginWithEmailAdress method.

For example, once you get the user input,you can check if the input contains "@" character. If no, then it must not be an email, you can call LoginWithPlayFab. Or, it might be an email, you can try with LoginWithEmailAddress to see if the user can login. If no, then call LoginWithPlayFab again in case the username contains "@" character.

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.