question

rte18 avatar image
rte18 asked

Unity & Playfab Registration Input Validation

What is the best practice for validating inputs when registering a user, and is there email validation done on the API's side?

Unity's input fields provide general validation options for things like a username (alphanumeric) and email (email address) and much more can be done at the code level, however when making a RegisterPlayFabUser request, I am unsure what checks are done by PlayFab and if I even need to run input checks at the Unity level (or if they are completely redundant).

Also, just so I am sure of how to handle error codes:

- InvalidUsername is given if the input doesn't match the alphanumeric check,

- What is the difference between NameNotAvailable and UsernameNotAvailable?

- is ProfaneDisplayName only going to be given if I have added the Community Sift add-on

Thanks in advance!

apis
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

·
Seth Du avatar image
Seth Du answered
  1. Username must not contain any characters and its length should be within 3-20, otherwise error code 1000: InvalidParams will be reported.
  2. UsernameNotAvailable will occur when the input Username already exists in your title. The detailed error message will be “User name already exists.” While NameNotAvailable occurs when DisplayName already exists in your title. The detailed error message is “The display name entered is not available.”.
  3. Yes, you have to implement Community Sift.

Basically, PlayFab will check the input for you, which means you can just handle the callback results for most of the cases.

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.