question

amit avatar image
amit asked

Anonymous login

Hey, I'm currently developing a game in Unity and I didn't quiet understand what I should do when the user chooses to login anonymously.

I mean, how do I save the details he entered in PlayFab and how do I check if he is logged in already so I can skip the login screen.

Thanks in advance.

Authenticationgame manager
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

·
Citrus Yan avatar image
Citrus Yan answered

Anonymous login mechanisms work pretty much the same as other login mechanisms except that they require no input from the player. Being anonymous creates a unique account in PlayFab for each player, for example, when the customer tries to use anonymous login on an android device, PlayFab will create a unique PlayFab account linked with the android device id for him, every operation the player later performed is on that account. However, if the player loses his device, he may not be able to recover it. You may have to ask players to add additional info for recoverable logins later in the game. Anyway, you should treat it the same as other login mechanisms.

how do I save the details he entered in PlayFab?

The same as players logged in with other mechanisms. For example, calling UpdateUserData API to write player’s custom data.

how do I check if he is logged in already so I can skip the login screen

Check if the session ticketisvalid by calling Client API calls. PlayFab SDK store it locally and re-using it automatically on all subsequent Client API call. If the calling succeeded, it means that the player has logged in, skip the login screen.

Here is the doc on anonymous login mechanisms: https://docs.microsoft.com/en-us/gaming/playfab/features/authentication/login/login-basics-best-practices

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

amit avatar image amit commented ·

Thank You!

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan amit commented ·

glad it helped:)

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.