question

brendan avatar image
brendan asked

Confused about Google login

Grogshotgames
started a topic on Tue, 28 July 2015 at 3:27 AM

Hi, I have successfully implemented Google login on my game, but I have a few questions that I need to understand before I continue working:

  • Google Login provided by Playfab is different from Google Play Services?

  • If that's true, is there a way to use Google Play Services instead, so I can use features like the achivements?

  • Everytime the user opens the game (even if the user had logged-in in a previous session), a Google login window pops-up. Is there a way to implement a silent login?

  • Same question as before but with facebook. Is there a way to implement a silent login?

Any help would be appreciated! :)

Regards,

Alberto

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

·
brendan avatar image
brendan answered

Best Answer
Brendan Vanous said on Mon, 03 August 2015 at 1:07 PM

Hi again,

You can link as many devices as you want to a single player account, but the key is going to be having another sign-in mechanism that serves as the "bridge" to that. So, once a player starts playing on one device, they need to have another sign-in that isn't Device ID dependent, so that they can use that to sign into the same account on another device, and then subsequently link that device to the original account. The flow for this would then be something like this:

  • User starts playing the game, chooses a "guest" account - no sign in. The PlayFab account is created at this point using the Device ID.

  • Later, you give the player some incentive to add a sign-in using Facebook or a username/password. This other sign-in is linked to the existing account.

  • When the user starts playing the game on another device, he can then choose "I have an account", sign in with the account using the info from the previous step, and then link the current device to the existing account.

Brendan


7 Comments
johntube said on Wed, 29 July 2015 at 6:36 AM

Hi Grogshotgames,

  • Yes "PlayFab login using Google" is different from Google Play Services sign in. The first requires Google's OAuth 2.0 Access Token which can be retrieved without signing in to any of the Google products and the latter is just signing in to Play Services. For more information about how "PlayFab's authentication using Google" is done please read the respective API request doc page (request details part) and take a look at this old discussion here.

  • You don't have to sign-in or get token every time the user starts the game ! I think you should follow PlayFab's recommended Login workflow you need to login using device ID.

  • With Facebook it's even easier ! At least for Facebook SDK for Unity, once signed in you can stay signed in "forever" unless you explicitly sign out. So while you're still signed in you can retrieve Facebook's OAuth token "as many times as you want". So the consent screen should not appear only if you sign out and sign in again !

HL


Grogshotgames said on Thu, 30 July 2015 at 2:54 AM

Thanks for the answers johntube!

  • I have successfully used the plugin that you created for geting the google token, and then I logged in with Google+. I thought it was the same as Play Services, but I guess that I need to get another plugin for that purpose. Now knowing that Play Services is something intrinsic in Android devices, why it is not part of the playfab login?

  • Well as far as I have try it, everytime I send a request with PlayFabClientAPI.LoginWithGoogleAccount, it shows a pop-up where I have to choose my login account, which is obviously really annoying. So, if this is the default behavior, why would anybody use it?? I supose there must be a silent login...

I'm not using device ID login as default because the game will be also available for windows phone.
- Great to hear! That's the way everything should work!


Brendan Vanous said on Thu, 30 July 2015 at 11:04 AM

Hi Alberto,

Yes, there are multiple silent login mechanisms you can use, and we'll have a "custom ID" you can use shortly, as well. One question: Why not use the Device ID login for iOS and Android anyway? We will have Windows Device ID login available in an upcoming sprint, but why limit your game on other platforms in the near term?

Brendan


Grogshotgames said on Sun, 02 August 2015 at 4:16 AM

Hi brendanv,

I'll go then with device id, i'm just worried about users with multiple devices. What is the best way to link all this devices to the same user account?

Thanks


Brendan Vanous said on Mon, 03 August 2015 at 1:07 PM

Hi again,

You can link as many devices as you want to a single player account, but the key is going to be having another sign-in mechanism that serves as the "bridge" to that. So, once a player starts playing on one device, they need to have another sign-in that isn't Device ID dependent, so that they can use that to sign into the same account on another device, and then subsequently link that device to the original account. The flow for this would then be something like this:

  • User starts playing the game, chooses a "guest" account - no sign in. The PlayFab account is created at this point using the Device ID.

  • Later, you give the player some incentive to add a sign-in using Facebook or a username/password. This other sign-in is linked to the existing account.

  • When the user starts playing the game on another device, he can then choose "I have an account", sign in with the account using the info from the previous step, and then link the current device to the existing account.

Brendan


Grogshotgames said on Tue, 04 August 2015 at 6:12 AM

So what would happen if in the second device I first login the user with the device ID, and then I ask the user if he wants to synchronize his account by login in facebook?
The user would have 2 different accounts at the beginning and then they will be automatically merged into a single account?


Brendan Vanous said on Thu, 06 August 2015 at 8:35 AM

We do not offer automatic account merging yet, since this requires game-specific logic concerning how to handle statistics, inventory, and user data. We will be offering this in future, but for now, any attempt to link a Device ID or third party service account, such as Facebook, which is linked to a PlayFab account, to a different PlayFab account will fail with an "already linked" error. Upon receiving this error, the title can offer the player the option to sign into their original account and link to it. 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.

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.