question

brendan avatar image
brendan asked

Link multiple device problem.

romkij
started a topic on Sun, 13 September 2015 at 9:29 AM

I have two device. First iOS, second PC.

On first device i call LoginWithIOSDeviceID, after that i call LinkFacebookAccount and all OK.

On second device i call LoginWithCustomID, after that i call LinkFacebookAccount and receive "LinkedAccountAlreadyClaimed", then i call LoginWithFacebook and when i try LinkCustomID i receive "LinkedIdentifierAlreadyClaimed". If before i try to call UnlinkCustomID i receive "AccountNotLinked".

And If i try link devices directly (on iOS i call LinkCustomID with customID from PC) i receive "LinkedIdentifierAlreadyClaimed" again.

10 |1200

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

brendan avatar image
brendan answered

3 Comments
Brendan Vanous said on Sun, 13 September 2015 at 2:55 PM

The important element is to understand that the user account is what users sign into. Each user account can be linked to multiple devices/services, but a single Device ID, Custom ID, or external service account can only be linked to one player account in your game. Otherwise, there would be no way to know which account you were signing into when you used one of those methods.

Let me walk though the flow listed, so that it's clear what's happening:

Devices: iOS, PC

Accounts: player1, player2

Since there's only one Device ID and one Custom ID in the flow, I'll just call them that.

First, an account is created (player1) on iOS, using Device ID. So, Device ID is now associated with player1.

Next, the Facebook account is linked to the same account - player1.

On the PC, an account is created (player2) using Custom ID. So Custom ID is now associated with player2.

You then attempt to link the Facebook account to player2. But it's already linked to player1, so that's not an option.

Then you log on the PC using Facebook, which is associated with player1, so you're now on the player1 account.

You then attempt to link the Custom ID to player1, but it's already associated with player2 - the account you created using the Custom ID.

Next, you tried calling UnlinkCustomID, but you're still signed into the player1 account. Again, player2 is the account with the Custom ID.

Back on the iOS device, which is signed in using Device ID, you're still on the player1 account. So when you try to link it to Custom ID (again, which is linked to player2), you get the same error you did above.

If you want to unlink Custom ID from the player2 account, you must be signed into that account. That means signing in using LoginWithCustomID, then using UnlinkCustomID. You would then be able to link Custom ID to the player1 account if you want to, after signing into it using either the iOS Device ID or the Facebook login.


romkij said on Sat, 26 September 2015 at 5:27 AM

Thank you, Brendan.

Problem with UnlinkCustomID, if i pass parameter "CustomID" to UnlinkCustomID, throws error. If don't pass parameter, all ok.


Brendan Vanous said on Sat, 26 September 2015 at 12:31 PM

What is the error you receive? In my own testing, if the UnlinkCustomID call is made with CustomId set to an ID which was previously linked, the response is OK and the ID is unlinked. What are you passing in for the ID on the link and unlink calls?

Brendan

10 |1200

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

Amar avatar image
Amar answered

Hi Brendan, 

How does this work with multiple iOS devices and multiple Android devices. Lets say a user has iPhone, iPad, Android phone and Samsung GearVR.

Based on my code all these devices create a new account with the device ID and create a new player ID and link these device ID;s to various player/userID's. Now if this user wants to connect all these devices using one external facebook ID, what would be a good work flow? How do you sync progress between multiple accounts ?

This brings be to the other questions of should you even allow creation of a ananomous Player/User account for each device? I have see the video that talks about the user login flow but it's not very clear on how to handle offline, ananomous and multiple devices usecase.

Our game is planned for iOS, iPad, Android,  AppleTV, GearVR,Cardboard. This usecase is going to popup all the time. Unless I have a good workflow for user login from the very beginning. Any recommendations?

 

10 |1200

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

brendan avatar image
brendan answered

In order to get the different devices all connecting to the same account, you would need to have a common sign-in of some type, in order to have a common identity to start with. Our recommendation is:

Give a new player (one with no local data) the option to start playing or to sign in with an existing account. If they choose "existing account", use the Facebook sign-in (or Google, etc. - any sign-in which can be common across devices). Then, you can link the new device to that account.

If the player just chooses to start playing and later tries to link the common sign-in mechanism (Facebook, etc.), but you find that it's already linked to an account, give the player the option to choose which account to keep. You can sign into both - one with the local Device ID, and the other with the alternate sign-in method, to get the data you need to let the user know which account is which. Once they've chosen, unlink the appropriate authentication method from the account they're abandoning, and link it to the one they're keeping.

10 |1200

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

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.