question

Ozden79 avatar image
Ozden79 asked

Update user e-mail through client API

Hi There,

Here's the first install scenario of my game which I would like to ask on how to implement in PlayFab (This actually works the way I described with another service at the moment) :

Once the game installed and launched the first time, I ask the user to choose a username. This username is validated against the current game users and if not already available, used to create an account on the cloud so nobody else can take it. In this process, I provide a temp e-mail and password to be able to create the account. Later, the user may choose to have his own e-mail and password attached to his username thus he/she can save the game data to cloud to synch with different devices. I do this by updating the account e-mail and password.

In PlayFab, as far as I know, none of the anonymous login functions provide you a way to set a username thus you try to create an account the same way I described above but than you can't update e-mail and password anymore to implement my scenario.

So in short, can somebody help me to implement a scenario where a username is provided at the install/first launch of the game and than a full account (meaning providing an e-mail and password) is created and/or updated later when needed?

Thanks...

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

·
brendan avatar image
brendan answered

For your user flow, what I would recommend is:

On first login, create an account using a Device ID (if this is a mobile game) or a generated GUID, using Custom ID login.

Use Title Display Name for the player's unique in-game name.

Later, when you have them from the player, use AddUsernamePassword to add email and password (and potentially Username) to the player account.

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

Ozden79 avatar image Ozden79 commented ·

Thanks for the answer. So, is "TitleDisplayName" checked against being unique when I try to set it? Because I need the usernames to be unique.

Also, I've some quite amount of user data, where some of them only has UserNames and no other data, which I would like to transfer to your system with a method like batch importing. Considering my unique Username need as well, can you suggest a way of doing this?

0 Likes 0 ·
brendan avatar image brendan Ozden79 commented ·

Yes, Title Display Name must be unique within the title, by default (though you can choose to make it non-unique).

For your data, can you clarify exactly what you mean? How much data is it per player? Your best bet is going to be to have the client initiate the update when they sign in, usually.

0 Likes 0 ·
Ozden79 avatar image Ozden79 commented ·

Brendan,

With data I just mean that I've a bunch of usernames (or "TitleDisplayName") which are already used and I need to import them to PlayFab.Is there any way for that?

I can create an update to my app and that update can do a customID login at first lauch as you specificed to secure the name but my concern is what if a new user gets the same username before that old user can secure it's name ;). Any suggestion for that as well?

Thanks a lot...

Özden

0 Likes 0 ·
brendan avatar image brendan Ozden79 commented ·

At the moment, the method above is what I would recommend. Since you do have to trust the client to provide the name for the player, there is some risk that someone might "claim" a name that really belongs to someone else, as you say. What you could do would be to turn on the "Append randomly generated digits to the player's display name" option in your title's settings, and then manage those incidents via your customer support channels.

In case it comes up in your internal discussions, yes, it's technically possible for you to write a tool that creates accounts using the Client API, if you have the credentials for sign-in (like Device ID). But there are two cautions I would call out regarding that:

1. We rate limit based on IP Address currently, so you would need to throttle that to be fairly slow - keeping it under one account per second.

2. Doing so would cause all your players to have your geolocation listed as theirs, since we tag accounts with the geolocation of the login. So you'd lose out on the information you'd gain by having them create their accounts directly, in that case.

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.