Lukasz Balukin avatar image
Lukasz Balukin asked

Correct way to resolve account link conflicts

I'm storing save in player's title data. Let's say we have a scenario like this.

User Bob owns Phone and Tablet.

Bob creates account and plays for a while using device login on his Phone, plays for 3 hours.

Bob then decides to start playing on Tablet for a while, does a fresh start with device login there but after 1 hour he decides that he wants to play on the Phone's 3 hour account instead of the 1 hour because he progressed further there.

Bob starts game on Phone, links into Google Play Games there. Phone's Account now has device login and GPG login.

Bob then starts game on Tablet again and attempts to link GPG there. He receives an error LinkedAccountAlreadyClaimed.

I currently have a solution that will temporarily log out Bob out of Tablet's 1 hour account, log Bob into GPG account, grab save data to let Bob decice which save to commit to and then, depending on Bob's choice it would either

- Log back into Tablet's 1 hour account and force-link GPG, commiting into 1 hour save and abandoning 3 hour save


- Link Device ID to 3 hour account and abandon previous Tablet 1 hour account which now has no login methods (because the only one was the Device Id that was just moved into 3 hour account.

It works but it seems that the process is very error-prone and fragile. If any other game feature wants to shoot an API call into Playfab during the account transitions, it may randomly be executed with incorrect auth ticket while the user is making the decision.

What I'm basically asking is if there is a way to get GPG's (or any other platform auth scheme's) server--usable auth code, send it to isolated process for example Azure Function and then log into temporary remote account there, grab data, and return it without rotating client's session multiple times. It seems possible but also looks like a very roundabout way of resolving the problem. Is there anything better?

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.

1 Answer

Gosen Gao avatar image
Gosen Gao answered

During the account transitions, you can create a new PlayFabClientInstanceAPI to login the second account. Since the PlayFabClientInstanceAPI can store the second account’s auth info independently, so both accounts can make API calls based on their own auth info. You can refer to

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.

Lukasz Balukin avatar image Lukasz Balukin commented ·

I somehow missed that there is a non-static version of PlayFabClientAPI. Thank you for your help.

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.