question

charlie avatar image
charlie asked

Urgent: Using Facebook Login to Migrate And Suddenly Not Working

Urgent: We are using Facebook login to transfer a player's Playfab account from an old version of our app to a new version. (This is the only way the app stores would let us switch publisher and continue to sign the apps in the store).

It was working well enough until today. The apps are live and a feature is claimed imminent so we are desperate.

The scenario is:

* player logs in with Facebook in the old app

* player follows a link to the new app

* player logs in with Facebook in the new app

1 we try to link the facebook token to this new record and get back that the facebook token is already in use.

2 we ask for the playfab account associated with that facebook token.

3 we get back the playfab account associated with the facebook token

4 we attach the new device id onto the same playfab account and the player continues with their old playfab account

As of today, with the game live in production, Playfab fails on step 3. the token is in use but we get back "null" for the account and cannot migrate the player!

Authentication
10 |1200

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

charlie avatar image
charlie answered

We have a fix but it isn't in the wild yet. Wanted to let others know if they have an issue. It does seem something has changed as our old method worked before. But what we do now is

*try to link to facebook

*if it fails, we ask the facebook graph api for ALL ids related to this business!

*we send them all to Playfab to find accounts

It seems there are (now) more than one facebook id coming back between the two apps in the same facebook business.

Thanks to @Andy for figuring this out in slack.

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.

Andy avatar image Andy ♦♦ commented ·

To add additional clarification in case it comes up again for someone:

The issue here was that the two different editions of the game appear to be getting two different ids on their Facebook tokens. This is expected and we have code in the LoginWithFacebook and LinkFacebookAccount APIs to deal with that scenario, so long as the two apps are in the same "business".

When we see a Facebook id we don't recognize on a Login or Link call, the first thing we do is call Facebook to see if that id is associated with another id in the same business. If it is, we store that relationship so we don't have to look it up again. GetPlayFabIdsFromFacebookIds is only aware of Facebook ids that have actually been passed in as part of a Link or Login call. This is what the core problem in this thread was; we had never seen the second id before.

In the scenario where one is attempting to migrate data from one title to another, the preferred method is to LoginWithFacebook. This will, assuming both titles are in the same business, log the player into their account on either title. IN the new title, if that's not what they wanted, you could then log them in using an anonymous method instead.

0 Likes 0 ·
Andy avatar image
Andy answered

What title ids are you migrating from and to? I haven't been able to reproduce any problems with Getting PlayFab Ids from Facebook ids on my test titles.

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

charlie avatar image charlie commented ·

Our playfab title id is 656B (withcy). We do not migrate across the title id. We have two iOS bundle ids however (and two android package ids). The idea is to get the user's playfab account from the old iOS (or Android) to the new iOS (or Android) by using the Facebook link (auth token).

We tested this and used it for weeks before it suddently stopped working (as far as we can tell)

0 Likes 0 ·
Andy avatar image Andy ♦♦ charlie commented ·

Have you verified that you're getting back the same Facebook Id in both the old and new apps?

If they are, I'd expect the call flow to look something like this:

Old App:

LoginWith*

LinkFacebookAccount

New App:

LoginWithFacebook

If they aren't the same, it's a lot more complicated and might explain why you're not getting back valid PlayFabIds in some cases..

0 Likes 0 ·
charlie avatar image charlie charlie commented ·

A little more detail on our method.

Whenever the player logs in with Facebook, we immediately attempt to link it to the playfab account via LinkFacebookAccount.

If this succeeds then we have the player's account (playfab player data) tagged.

If this returns the "error" of PlayFab.PlayFabErrorCode.LinkedAccountAlreadyClaimed, then we consider it an attempt to link a new device to the same account. Maybe he was playing on Android tablet and now he wants to use an iOS phone too. Or, in the current case, maybe he played under our old publisher and now he wants to switch his progress to the new publisher)

So in the case the facebook token is already linked, we ask for the "old" player progress account from Playfab. This has always worked. Now it doesn't. It returned null.

(Our next step would be to link this new devices (tablet, new sku) into the same playfabid so the player can continue progress. but we don't get to this step as we didn't get back a playfab id)

0 Likes 0 ·
Andy avatar image Andy ♦♦ charlie commented ·

I sent you a DM on slack. I want to dig into this a little bit more.

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.