Sign In Register

How can we help you today?

Start a new topic
Answered

RegistrationRequest and returning user

Hi


I am giving users when then first open my game the option to connect with Facebook or to create an account using username / password.  I'm using RegistrationRequest to create the account which seems to work fine, but next time the user returns to the app what is the best approach to retrieve their information? should I be using DeviceAuthenticationRequest or is there another way ?


Any help is appreciated?


Gavin


Best Answer

Hey guys,


To answer your original question Gavin if you register a user with RegistrationRequest, the created auth token is cached and auto-renewed by the GS library, so when the user returns they will automatically be logged in. The users will only have to enter their details again if they log out.


As Greg says a lot of games will do a DeviceAuthenticationRequest silently to get users in and playing the game before later prompting them to sign up with Facebook or a standard username password RegistrationRequest. Alternatively after a DeviceAuthentication you can have the registration form in your game set up to send a ChangeUserDetailsRequest (remove the old password field), this will effectively merge your DeviceAuthentication with a regular Registration, allowing players to sign in with a username and Password from there on.


Thanks,

Liam


Hi Gavin,


As per the authentication section in the api docs, if they are authenticated with Facebook, use a FacebookConnectRequest
https://docs.gamesparks.net/documentation/request-api/authentication-request-api/facebookconnectrequest

Or if through a username and password, use AuthenticationRequest

https://docs.gamesparks.net/documentation/request-api/authentication-request-api/authenticationrequest

You should always initially authenticate a user for the first time with DeviceAuthenticationRequest, and not force them to authenticate in any other way.

Then once the user is active in your game, allow them to connect with Facebook, or use a username and password, and then connect with those methods thereafter.


Creating an 'authentication wall' is considered bad practice and many users will exit your game if they don't feel comfortable registering or linking to Facebook yet. 





1 person likes this

Thanks for the reply Greg, the reason I am offering the choice to users straight at the beginning to connect with FB or create an account is because with DeviceAuthenticationRequest doesnt generate any sort of username, which in the game is displayed in the user stats on the right hand side of my menu and having it blank doesnt look particularly great. Rather than me generating a random username for everyone that plays the game it just looks better if they had the username of their choice.  I have presented an option to "skip" login or registration which then uses DeviceAuthenticationRequest but really wanted this to be a last resort option for the user

Thanks for the reply Greg,


The reason I am wanting to use DeviceAuthenticationRequest as a last resort is because users that are not using FB or creating an account have no display name set which is shown in the user panel on the right hand side of my menu system and it just looks a little poor having no username.  I could create random names for users using device authentication but thought it better than users pick their own.  I have added an option to skip using FB or creating an account but really wanted this as a last resort option for users so that they are creating their own display name.

When they authenticate with their device, just ask ask them to type in a username? It's still a lot better flow than forcing them to connect to Facebook or registering with a username and password.

But then is there really that much of a difference between asking them to pick just a username or to pick a username and password ? Seems like a trivial difference to me, so for now I will stick with username and password ( should the user choose to on first running the game ) and if I get a lot of feedback about this I will address it again. Thanks for the help
Answer

Hey guys,


To answer your original question Gavin if you register a user with RegistrationRequest, the created auth token is cached and auto-renewed by the GS library, so when the user returns they will automatically be logged in. The users will only have to enter their details again if they log out.


As Greg says a lot of games will do a DeviceAuthenticationRequest silently to get users in and playing the game before later prompting them to sign up with Facebook or a standard username password RegistrationRequest. Alternatively after a DeviceAuthentication you can have the registration form in your game set up to send a ChangeUserDetailsRequest (remove the old password field), this will effectively merge your DeviceAuthentication with a regular Registration, allowing players to sign in with a username and Password from there on.


Thanks,

Liam

Login to post a comment