Sign In Register

How can we help you today?

Start a new topic
Answered

Login Screen

So I am using Unity for my online game.


As for most of the games, When I start the app again, I want the user to be automatically logged in all the way.


What is the best practice to achieve that?


What I did is the following:

- First time registration, app saves username in PlayerPrefs.

- If app is closed then opened again, code checks for "username" info in playerPrefs.

- If info is not null, the app sends the authenticationRequest, else app shows the login screen.


Looking forward for your feedback


Thanks,


Best Answer
Hi Mohamad!

That is a nice simple Registration/Authentication pattern! If you wanted to have more than one account on a device you could also store a list of user details(Accounts) if for Eg, your game was a web player game! If your game is going into full development i would also consider saving the user details in a json or xml so that you can better project them, playerPrefs are unsecured!

Regards,
-Dave

 

1 Comment

Answer
Hi Mohamad!

That is a nice simple Registration/Authentication pattern! If you wanted to have more than one account on a device you could also store a list of user details(Accounts) if for Eg, your game was a web player game! If your game is going into full development i would also consider saving the user details in a json or xml so that you can better project them, playerPrefs are unsecured!

Regards,
-Dave

 

Login to post a comment