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?
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!
Answer by Brendan · Jan 08 at 08:09 PM
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.
Answer by morlando616 · Jan 08 at 07:48 PM
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.
Answer by morlando616 · 6 days ago
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!
Answer by Brendan · 6 days ago
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".
Answer by morlando616 · 6 days ago
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.