question

Avishy Menashe avatar image
Avishy Menashe asked

Connection with google play and account switching

Hello!

in out game we can currently start a game with a user that logs in using the "LoginWithPlayFab" call.

in the middle of a session I want to allow my players to connect with google play.

after a player has connected with google play I create a *new* user (in playfab) and clone all of the game data into it.

from that moment forward I remember the google username the player has connected with - their Social.localUser.id - in order to allow them to automatically connect the next time the open the game.

I am trying to find a way to delete the "old" account - but cannot seem to find how? I have researched the Admin api calls but can't seem to get it right.

the main problem is that if a player plays without connecting to google play - we use their device ID to login - meaning only that specific device can connect to that specific account.

we want to use google play to allow players to connect to their account from other devices.

what should I do?

another question - can any one think of a different/better way to approach this problem? is there any way to change a playfab username to a new one when logging in with google play?

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

·
Gosen Gao avatar image
Gosen Gao answered

>> the main problem is that if a player plays without connecting to google play - we use their device ID to login - meaning only that specific device can connect to that specific account. we want to use google play to allow players to connect to their account from other devices. what should I do?

You don’t have to delete the old account and create a new one for google login, you can use API LinkGoogleAccount to add google as a login method to players to let them login with google account on any devices they want. For more info, please refer to Setting up PlayFab authentication using Google Play games sign-in in Unity.

>> another question - can any one think of a different/better way to approach this problem? is there any way to change a playfab username to a new one when logging in with google play?

If the user has set the username then it is not able to change it. If you want the PlayFab username same as the Google username, you should set the PlayFab username after the Google account has been linked. If you cannot change the workflow like that, and you have to delete the old account, then you can use API DeleteMasterPlayerAccount to delete the master player account or API DeletePlayer to delete the title player account. For more info about title player account and master player account, please refer to Available built-in entity types.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Avishy Menashe avatar image Avishy Menashe commented ·

Thank you so much!

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.