question

Richard Bates avatar image
Richard Bates asked

LinkGoogleAccount problem with master accounts and multiple titles

We have a game that's launched on iOS and we're working on readying the game on Android.

On iOS, we do an initial login with the device ID, and we offer users the possibility of signing in with Apple, at which point we link that Apple account to the existing PlayFab account.

We're taking a similar approach with Android, offering signin to Google Play Services.

One more thing to know is that we have a separate title on PlayFab for testing. Through the game's development (before we added PlayFab) we have used a separate app identifier / bundle ID - sometimes referred to as a 'flavor' - for development versions. We maintain that with PlayFab for various reasons, including that we don't want to contaminate leaderboards with test data, and we want to be able to unlink accounts for testing various situations without fear of harming real users. Of course we still do some minimal testing on the production environment to confirm that it's configured correctly.

The problem is that if a tester has signed in with Google using the test bundle ID/title, repeating the process with the real ID/title fails - "That account is already linked to a different user".

We may need to use different Google accounts to guarantee uniqueness and avoid the two titles interfering with each other in this way. Are there other approaches we could take?

I understand the benefit of trying to identify a user across titles, but it seems that device IDs on iOS & Android, and Sign In With Apple identities are already 'uniquified' to prevent that. If we did have multiple live titles and a user had created separate device ID accounts for each, and later chose to sign in with Google for each, how should we handle it?

Account Management
10 |1200

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

Rick Chen avatar image
Rick Chen answered

Once the player has registered an account in a title under a Studio, he can directly login to another title under the same Studio, without the need of registering another time. If the player has linked the google account under an account in a title, he should be able to login with the google account in another title under the same Studio. The master account is shared across all title under a Studio. This is by design. It is not necessary to register a new account and link the google account to the new account in the new title.

If you decide to let players register new account in new title, you could create another studio and create the title under the new studio. This would separate the master player account in different titles.

10 |1200

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

Richard Bates avatar image
Richard Bates answered

Right, I understand that’s the intention, but what should clicking ‘Sign In With Google’ actually do, if LinkGoogleAccount is incorrect?

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.

Rick Chen avatar image Rick Chen ♦ commented ·

It depends on what you would like to achieve. If you would like the users to abandon the old test account, then link to the new account on new title, you could do UnlinkGoogleAccount first to unlink the old account. Then do LinkGoogleAccount to link the new account. If you do not wish the user to create another account on real title, you can directly use LoginWithGoogleAccount to login as the old account. Please note that if a player has multiple master accounts across different titles under the same studio, he can only link one of his master accounts to one google account, linking another account to the google account requires unlinking original one.

If you have any further question, please feel free to ask.

0 Likes 0 ·
Richard Bates avatar image
Richard Bates answered

Real users won't ever see the test project, it only affects us and our QA team. But it affects our QA team in a way that wasn't obvious, and harms the 'sterility' of tests, as our dev environment interferes with our prod environment. We can work around it, but I'd like to continue the discussion as I'm concerned.

What we'd like to achieve is broadly what's set out in the blog post here: quickly onboard players with a device ID, and switch to a recoverable method later:

1. Users login with their device ID.

2. Users can later choose to link a recoverable method, i.e. Google.

The problem with discovering at step 2 that a user already has a master account with those Google credentials is that by logging in with that account, they'll abandon their device ID-base account and lose their progress so far.

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

Rick Chen avatar image Rick Chen ♦ commented ·

Yes. You can use the frictionless method for authentication.

In your step 1, if the user login with the same device ID as the one in other title under same studio, and if the user has linked the device ID to the Google account in the other title, they don’t need to link again, and can skip the step 2.

Do you mean what if the users use another device, they login with their 2nd device and want to link the device with the recoverable account? This is achievable. Please refer to this document: Add new devices to an existing recoverable account. In that case, you do need to provide the user an option to login via a recoverable mechanism and not automatically log in with the device ID. Otherwise, like you mentioned, the user will be warned against losing an account they never intended to make.

0 Likes 0 ·
Richard Bates avatar image Richard Bates Rick Chen ♦ commented ·

I want to bring this conversation back on track a little as really, we're a very small team, we want to use PlayFab in a very simple way and we don't have time to explore the fine workings of various Android IDs etc.

To re-state the problem: We want to use a login flow, similar to those in the First Impressions Count blog post, where we use an anonymous (device ID) login method, and then optionally link to a Google or Apple account later.

Issues:

1. Apparently the Android Device ID mentioned in that blog post is not ideal. What anonymous login should we use instead? (And may I suggest you amend the post if Android Device IDs are considered harmful)

2. The method breaks if we launch a second title. If an Android user installs two games published by us on a single device, then linking their Google account will fail for the second game, because (my understanding is that) a second master account will have been created for the second device ID (which is not the same, even for the same device). It seems that we need to be able to detect that situation, and migrate the ownership of the second game's Title Player Account to the first/original Master Player Account. Is that possible?

1 Like 1 ·
Thiago Lopes Rosa avatar image Thiago Lopes Rosa Richard Bates commented ·

I'm developing the second game using PlayFab and I just encountered this exact issue... =/

0 Likes 0 ·
Richard Bates avatar image Richard Bates commented ·

“In your step 1, if the user login with the same device ID as the one in other title under same studio, and if the user has linked the device ID to the Google account in the other title, they don’t need to link again, and can skip the step 2”


This doesn’t work though - the device IDs are different between apps on the same phone.

(If the device IDs were the same, we wouldn’t have encountered this issue)

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Richard Bates commented ·

For iOS devices, the player ID changes if they uninstall your game, and then re-install it. One way to make sure you have a consistent ID on iOS is to save the device ID for the player to the iTunes KeyChain, so that you can read it from there on game start, and use it to sign in.

For android devices, see the latest best practices in Google's guidelines on user data ids.

Please refer to Login basics and best practices for more detail.

0 Likes 0 ·
Richard Bates avatar image Richard Bates Rick Chen ♦ commented ·

"For android devices, see the latest best practices in Google's guidelines on user data ids."

Which of the 4 identifiers listed in that document does PlayFab's Android Device ID use?

0 Likes 0 ·
Show more comments

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.