question

David Coombes avatar image
David Coombes asked

Best workflow for adding new user via email

I want my user experience to be a case of putting in an email address and password and being signed up for cross-platform game syncing.

For this, my user puts in their email and password and I perform a login or account creation. Trouble is, there's no obvious way to test for the account and then log in or create.

LoginWithEmailAddress doesn't have a 'createaccount' option unlike log in with custom ID. Reading around, it looks like I need to perform a login, and then in the error trapping, when there's no account, create one.

Is that the intended workflow, as opposed to calling some 'DoesAccountExist' method?

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

LoginWithEmailAddress, as well as LoginWithPlayFab, doesn't have a 'createaccount' option, because it requires an exact match of username/email and password. If the Username or email account doesn’t exist, "User not found" error will be reported, you may read the error code from the callback result, to determine the existence of an account. I believe the work around solution is adding additional steps when player logins and automatically call RegisterPlayFabUser if "User not found" is reported. The whole process will be silently and seamlessly so that players won’t notice.

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.