I want players to register only with e-mail and password but when I try this, I get this error on Unity:
/Client/RegisterPlayFabUser: Both username and email are required unless specified with RequireBothUsernameAndEmail
Is there a solution for this?
Answer by v_humcin · Jun 03, 2019 at 05:04 PM
"RequireBothUsernameAndEmail" is a parameter in the RegisterPlayFabUserRequest and is set to true by default. You can add it to your request and set it to false which will allow you to register without a username specified.
RegisterPlayFabUserRequest request = new RegisterPlayFabUserRequest() { Email = "example@me.com", Password = "password", TitleId = PlayFabSettings.TitleId, RequireBothUsernameAndEmail = false };
You can find more information about it in the documentation: RegisterPlayFabUser