question

vsilvaratnam avatar image
vsilvaratnam asked

New Account Created although already existing (login using google games).

Our test(has already linked a google games to his/her account) bought an in-app purchase and then pressed the login with google games button after restarting his game(closing and opening his application).

A new account was created instead of logging in with the existing one. The old had everything unlocked. To provide much more context, we first call the client api loginwithgooglegames and in the result we check if(result.NewlyCreated) before we proceed to link the android device(forcelink=true).

The odd part about this is that he is already logging in with a google games account which is already registered in the playfab system. However a new account was created and then this android device was forcelinked to this new account.

The outcome should have been false for the if(result.NewlyCreated) check. Is there a reason this is happening?

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

If the same credentials are sent, the login call will always result in signing into the same PlayFab ID. What Title ID are you testing, and what are the PlayFab IDs of the player accounts in question, so that we can look into this?

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

vsilvaratnam avatar image vsilvaratnam commented ·

Hello Brendan,

The title ID i am using is 5B52. The player was first in account 477030BA413ABB61 (which was created using autonomous login android). The player proceeded to sync with google games linking google games with the player's account.

Later when the player pressed login with google games in the same device, a new account was created instead of using the existing one. The player's data was not lost luckily since we always sync local data with the server. So in this case, player did not lose data,virtual currency or items but the purchase receipt is in the old account. The new account which was created is 61469C6610DA9D6B.

0 Likes 0 ·
brendan avatar image brendan vsilvaratnam commented ·

Reviewing the event history, PlayFab ID 477030BA413ABB61 was never linked to a Google account (https://developer.playfab.com/en-US/5B52/players/477030BA413ABB61/event-history). The only thing the player did, in terms of authentication, was create the account using an Android Device ID, and use that for sign-in (and then unlink it when they created a new account using their Google account - https://developer.playfab.com/en-US/5B52/players/61469C6610DA9D6B/event-history).

Basically, the client should have used LinkGoogleAccount to attach the Google auth to the existing account (while logged into it, using the device ID). Instead, it called LoginWithGoogleAccount, with CreateAccount set to true.

0 Likes 0 ·
vsilvaratnam avatar image vsilvaratnam commented ·


So what happens when we press the button is that the player logs in using google games and then proceeds to check if result.newlycreated.
if true,

link the device id with this newly created account.

if false,

ask the player if they want to overwrite the existing google games account's data or replace the data on the phone with the google games account's data.

Based on our code, we must have got a result.newlyCreated == true. I can't seem to understand why.

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.