question

Dale Strickler avatar image
Dale Strickler asked

When to link accounts?

We are working on a game that allows certain features only if a player registers and provides an email address. Basically a RegisterPlayFabUser call with an email address provided.

They can play without the features by not registering so we do a device login LoginWith...DeviceID as soon as the game starts.

If the player wants to connect with Facebook we allow that too. So they can share their progress. We do not get or use any data from Facebook though at some pint we may use their list of friends.

One of the features they get by registering an email is having the game data shared across devices.

We always start the game with a device login. Then we check the account data to see if we have an email. If we do we show the features and don't ask for registration. If we don't have an email, then no features and we pester for registration.

Using this flow it seems like the device ID accounts get auto-linked to the main PlayFab account by the RegisterPlayFabUser call (or by calling LoginWithPlayFab if they have an account) always happening after a LoginWith...DeviceID call. Right?

I am not seeing why we would ever need to call one of the LinkAPIs, like LinkAndroidDeviceID. At least so far in testing it seems like we never need the link calls. I am missing something? Does something more link with the explicit link calls?

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

·
brendan avatar image
brendan answered

No, if you're calling LoginWith...DeviceId with CreateAccount set to true, you're creating a new, separate account if that device ID isn't linked to an existing account. There's no way we can link the device ID in the RegisterPlayFabUser call, as we don't get it from that call.

In general, titles create a "guest" account first using a device ID, then link recoverable account types (username/password, Facebook, Google, etc.) later. I'd recommend reading this doc on linking recoverable account types, as it goes into this in more depth:

https://docs.microsoft.com/en-us/gaming/playfab/features/authentication/login/quickstart

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.

Dale Strickler avatar image Dale Strickler commented ·

Okay... It seems to me added a Device Id to the PlayFabRegister and PlayFabLogin would simplify this a lot...

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.