question

Matt avatar image
Matt asked

Linking Multiple Of Same Platform

Is it feasible to play the same account with 2 different devices of the same platform. In other words...can a player play my game on an iPhone as well as his/her iPad?

- Player1 calls LoginWithiOSDeviceID using the device ID from iPhone (creates new account)

- Player1 calls LinkFacebookAccount

- Player2 calls LoginWithiOSDeviceID using the device ID from iPad (creates new account)

- Player2 link fails with LinkedAccountAlreadyClaimed error

- Player2 calls LoginWithFacebook and is now using the first account created (as desired)

- Player2 wants to link this UDID with LinkiOSDeviceID

I know I can avoid the issue by just using LoginWithFacebook in the first place. I would really prefer not to, and instead rely on the deviceIDs as a known constant. I plan to save to a local file the player's preferred way of logging in, but I don't want to have to rely on that. Since I only use Facebook for the Friends Leaderboards, I only need to bother logging in when the token expires (on mobile they last forever). Honestly, I just don't want to jam a 'Sign into Facebook' button as the first screen. The login return tells me if Facebook is linked, so I never need to bother the player if I can get away with always logging in with device ID.

So really I have 2 questions...

1) Is that LinkIOSDeviceID call feasible? Isn't the iOS Device ID of that account the one from the phone?

2) If I can the iPad with LinkIOSDeviceID...can I link any number of other iOS devices?

Thanks!

-Matt

This may not be the last question I have on this topic, I'm sorry...I know everyone must be sick of account linking questions!

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

Yes, you can have multiple iOS Device IDs all linked to the same account. Right now, we only show the one you most recently used to log into the account in the Game Manager and user account info query - that's something we'll be fixing in an upcoming sprint.

But I'm not clear on the flow you described above. If player 1 signs in for the first time using one device, and then player 2 signs in for the first time with a different device, that would be two separate accounts. What does the "link fails" bullet refer to, exactly?

Supporting a single player on multiple devices requires good user flow for the login process, so that you guide players back to the same account. For example, showing the Facebook login with some text near it saying something like "Already have an account?" Otherwise, you will run into the issue of a player with multiple accounts who then gets frustrated if he can't consolidate to one account across all devices (which, once they have multiple accounts, you would have to do by signing into one, reading data from it, then signing into the other and using the ForceLink parameter to move the first account's credentials to the second - or just abandoning the other account).

The Device ID is a great mechanism for getting the first-time player into your game with zero friction. And if you're not using any Facebook-specific features (like their friends list), you don't need to use Facebook every time, though making sure to get the user to choose it the first time on a new device is important, to make sure they get back to their existing account. But you could then use Device ID going forward, to make sure there's no interruption to the user experience.

By the way, for iOS, we recommend saving the player's Device ID to the iTunes Keychain the first time they play your game. That way, you can check the Keychain on start, and you'll get that ID from their account no matter what iOS device they're using.

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

Matt avatar image Matt commented ·

That failed link was player 2 trying to link Facebook so he/she could continue their game. I didn't realize, however, that you can actually link more than one device of the same platform. I saw that one entry and assumed I could only hook up a single iOS device.

I'll simply log into Facebook, give them the option like you suggest and then link accordingly. I think I've got most of this mapped out now...the Facebook account is the one common thread I'll use.

Thanks for the help!

0 Likes 0 ·
Matt avatar image Matt commented ·

Quick question. When I sign into Facebook on the second device (iPad in my case) and then unlink the iPad DeviceID from Account2 and link it to my Facebook account, Account1 (which was created on my iPhone)...will that previous Account2 be orphaned?

The only 'link' to it was the iPad ID which is now pointing to Account1.

0 Likes 0 ·
brendan avatar image brendan Matt commented ·

Correct - if that's the only authentication mechanism you have for account 2 (nothing else linked to it), then there would be no way to sign into it anymore.

0 Likes 0 ·
Matt avatar image Matt brendan commented ·

Awesome, I think I finally get all of it now! No more questions from me, though I may post my final solution (when I finish) to help anyone else passing through.

Thanks for the help though, this is great!

0 Likes 0 ·
Show more comments
andymaddison avatar image andymaddison commented ·

@Brendan it's nearly 5 years later and those fixes you mentioned still aren't implemented. Will they ever be?

0 Likes 0 ·
Matt avatar image
Matt answered

To potentially answer my own question...I've been thinking about it more, and I'm starting to think that really the only 'correct' way to do this is to save to a local file if they play using a Facebook Account and then LoginWithFacebook if that's the case. In this scenario, they can play the same account on 12 different devices.

New accounts won't have that set so it's just UDID. They can link to Facebook. If it's already linked, I'll know that from the return and just log them into Facebook. If Facebook is linked to another account, like the phone in my case, I'll let them log in with Facebook or continue as a guest (and again, saving all of this to a local file so on start up I know exactly what to do).

That seems to be the correct or expected way to handle login...I want to bother the player as little as possible. And more importantly, I only want to have to login once ( to avoid having to send the player back to the menu)...this solves that minus the first time they play on a new device. I'll have to just offer a Skip Tutorial option of some sort since I wanted to launch them right into the game.

If anyone has anything to add or perhaps some loopholes or snags I should know about, please feel free to comment! I'm going to reluctantly move forward, for now, with this local file Login approach.

10 |1200

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

Matt avatar image
Matt answered

So I encountered something unexpected and I'm wondering what the best practice is. I'll do the standard this guy / that guy routine again so it's clear (helps keep things straight for me).

iPhone makes device account.

iPhone links Facebook.

iPad makes device account.

iPad links Facebook (fails, I then chose to log into that Facebook account and link the device)

iPad removes Facebook link.

iPhone earns 500 coins.

iPad is on the same account still and gets those 500 coins.

So when the iPad removes the link to Facebook, the iPad account (device ID) is still linked to the same account as the iPhone (which is still also linked via Facebook).

What I'd love to do is sort of clone that account. I'd want the iPad to detatch itself (because it detached via my common sign-in mechanism, Facebook) and now point to its own account, albeit one with all the same data as the account we are removing ourselves from.

Has anyone seen or done that before? Is there an easy way to handle the type of situation like this...where the iPad lost it's link to the original account after signing into Facebook and linking the device. Now the device, iPad, removes the Facebook link.

Thanks, sorry to be so wordy!

-Matt

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.

Matt avatar image Matt commented ·

Oh btw, I already have a well stocked pop-up when they choose if they want to link with the original account. They are well aware that they are abandoning that save game, but I like the idea of letting them Unlink from Facebook and go solo again.

0 Likes 0 ·
brendan avatar image
brendan answered

The best thing to do is what you mentioned - be clear about the fact that they have a separate account. Preferably, show them some detail from each and let them choose. You can optionally read some data from the account you're unlinking in order to pull it into the other account, but that's entirely down to your game's needs, as that won't work for everyone. But in the scenario above, it sounds like there's a missing step. After the iPad signs into the account linked to Facebook, you would need to link the Device ID (for the iPad) to that account, using the ForceLink option. Only then would the iPad's first account be "lost".

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.

Matt avatar image Matt commented ·

This is a very temp version of the menu I'll show in the game, but I'll be laying it all out for them. This is something that won't happen often anyway. Oh the step "iPad links Facebook (fails, I then chose to log into that Facebook account and link the device)" mentioned the device linking. I've tested it (ironically on an iPad and iPhone) and everything works great!

Once the devices are linked (with or without Facebook), I'll just force them to remain linked. If I find people want the ability to detach the device completely (like if they want to pass down an old iPad to their kids or something) then I'll have to add the option to unlink the device entirely.

0 Likes 0 ·
screenshot-1.png (68.5 KiB)
Matt avatar image Matt commented ·

Speaking of which, if I did want to be able to completely separate an account...I couldn't do that from within that account, right? I'd have to log into the other device (iPhone) and unlink the (iPad) device ID from there. Then logging into iPad will create a new account (I'll always have flag to true with device logins).

0 Likes 0 ·
brendan avatar image brendan Matt commented ·

When you use a Login... call, you get back a Session Ticket for the account associated with the credentials used. If you're using one of our SDKs, at that point we save the Session Ticket for subsequent API calls - which is to say, you're only logged into one account at a time, since we only save one Session Ticket in our SDKs.

By the way, my general recommendation for iOS devices is to use the Keychain to store the Device ID the first time they play your game. That way, on game start you can check the Keychain and re-use the Device ID you stored there for that player.

0 Likes 0 ·
Matt avatar image
Matt answered

I would use the Keychain but I'm developing this for Android as well so it's just easier with 1 generic system (minus a couple #defines). Plus testing on PC is also nice while I work.

As far as the session ticket goes, I'm not sure I follow. If I had 2 mobile devices linked to the same account, now without the common sign-on being Facebook. If I wanted to unlink one of them, I can't just call UnlinkIOS/A/C from that device, because it's already logged into that account...it's like unlinking itself which is impossible, right?

Would I tell the user that if they want to detach the iPad, they'd have to sign in on the other device and the unlink the iPad account?

This sounds complicated and potentially not feasible, and if that's the case...I'm more than happy to leave the system as is. Worst case I could save a local customID to disk, based on time maybe, and add a branch in code to login that way.

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

brendan avatar image brendan commented ·

Yes, the keychain recommendation is solely for devices connecting to Apple's iCloud - for other platforms, you would need to use the local device ID (for PC, you could just use Custom ID).

But no, there are only two ways to unlink credentials from an account: 1) by being signed into that account, or 2) by using the ForceLink parameter to add the credential to a different account (stripping it off the currently-associated account in the process). So yes, if you want to give the player the option to remove the device from the account, that's fine - you can call Unlink... for the signed-in account.

0 Likes 0 ·
Matt avatar image Matt brendan commented ·

If I unlink a deviceID from the device I'm on, what account will that be pointing at? And what account would the other device that was linked be pointing at?

0 Likes 0 ·
brendan avatar image brendan Matt commented ·

If you're signed into an account that has a Device ID linked, and you unlink that ID, it's not pointed at any PlayFab account. If a Device ID is linked to account 1, and you use ForceLink to link it to account 2, it's pointing at account 2, and not 1. But in neither of those cases would that affect what account the other device is pointing at.

0 Likes 0 ·
Show more comments
Matt avatar image Matt commented ·

I see, ok that's great. Thanks for the 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.