question

Hussien avatar image
Hussien asked

Both username and email are required unless specified with RequireBothUsernameAndEmail

Hello I have this error when try to login with PlayFab what the solution for this?

,

/Client/RegisterPlayFabUser: Both username and email are required unless specified with RequireBothUsernameAndEmail. UnityEngine.Debug:LogError(Object) PlayFabLogin:OnRegisterFailure(PlayFabError) (at Assets/Scripts/PlayFabLogin.cs:67) PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:259) PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:197) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

unity3d
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

·
madmojoman avatar image
madmojoman answered

You probably forgot to send both username and email in the registration request. Maybe setup a log to verify what data you're sending before you send the request. And if still having trouble maybe show the code you're using for the request so you could get some help figuring out what you're doing wrong.

6 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.

Hussien avatar image Hussien commented ·

i added the user name and password to the variables in my code as hard code

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Hussien commented ·

Did you add an email address in your code?

0 Likes 0 ·
Hussien avatar image Hussien commented ·

but now i have this problem when exported game to test it on xcode using facebook authentication and i install bolts pod

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Hussien commented ·

We noticed you post a new thread about this question. You can navigate to it https://community.playfab.com/questions/34405/xcode-problem-with-unity.html.

0 Likes 0 ·
John Clark avatar image John Clark commented ·

This doesn't seem quite right as the documentations says: "You must supply either a username or an email address." But this sounds like you must supply BOTH a username AND an email address. Could we get some clarity please? (Especially in the documentation if in fact this is incorrect)

https://docs.microsoft.com/en-us/rest/api/playfab/client/authentication/RegisterPlayFabUser?view=playfab-rest#registerplayfabuserresult

0 Likes 0 ·
John Clark avatar image John Clark commented ·

This doesn't seem quite right as the documentations says: "You must supply either a username or an email address." But this sounds like you must supply BOTH a username AND an email address. Could we get some clarity please? (Especially in the documentation if in fact this is incorrect)

https://docs.microsoft.com/en-us/rest/api/playfab/client/authentication/RegisterPlayFabUser?view=playfab-rest#registerplayfabuserresult

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.