question

Matt avatar image
Matt asked

AccountAlreadyLinked vs LinkedAccountAlreadyClaimed

I'm implementing LinkFacebookAccount and notice of 4 returnable error codes, 2 of them sound identical.

AccountAlreadyLinked, based on the First Impressions article, says that the Facebook account has already been linked to some other account, so I would then Login using Facebook and then link, instead, the iOS/Android UDID.

Does that mean, then, that the LinkedAccountAlreadyClaimed error code pops up if the account I'm signed in as is already linked to a different Facebook account?

Thanks for the clarification!

-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 ·

Also, hand in hand...where and how am I told when a Playfab session has expired and I need to relog into Playfab?

0 Likes 0 ·
brendan avatar image
brendan answered

Actually, it's the other way around - LinkedAccountAlreadyClaimed in this context means that the Facebook account is already linked to another PlayFab ID, while AccountAlreadyLinked means that the PlayFab ID is already linked to a different Facebook ID.

As to the expiration of the Session Ticket, you will get an error from any API call other than login or password reset that indicates that the ticket is no longer valid, once it has expired.

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

I think it may be worth noting that the First Impressions article may have the incorrect information (which really doesn't matter, it's only an overview of best practices). It says:

"Then, later in the game, you would call LinkFacebookAccount to link the player’s Facebook credentials to the current account. If the Facebook account was previously linked to another account, you would receive an error message, “AccountAlreadyLinked,” and would proceed instead to use LoginWithFacebook to recover the old account. You would then call LinkAndroidDeviceID or LinkIOSDeviceID to link the current device ID to that old Facebook account."

In any case, thanks for the clarification, it sounds like I really only need to concern myself with the InvalidFacebookToken and LinkedAccountAlreadyClaimed.

Oh, as far as the session ticket expiring goes...what would I specifically check? For instance, the LinkFacebookAccount function doesn't return anything.

5 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 ·

Thanks for calling that out - we'll definitely review the tutorial to get that corrected.

For the check for an expired session ticket, the error code is 1074 (NotAuthenticated). And all API calls will return something - there should never be a case where you get no response at all. If you think you're seeing a case where nothing is returned, can you provide specific repro steps?

0 Likes 0 ·
drallcom3 avatar image drallcom3 brendan commented ·

The tutorial still incorrectly talks about AccountAlreadyLinked when it's actually referring to LinkedAccountAlreadyClaimed.

0 Likes 0 ·
Matt avatar image Matt commented ·

Ah ok, thank you that makes sense now. I haven't made any calls yet, I'm just setting up the code to catch all cases.

I do highly recommend, though, adding *every* return code to the functions in the API. Especially because I don't really know how to easily test an expired session ticket with Playfab, I'm relying on my error checking to catch every possible scenario so I need to know what to actually check for. That list of error codes is HUGE so I really have to rely on the documentation.

Are there any other return codes that could occur other than the expired session ticket (NotAuthenticated) and the ones actually listed in the docs?

0 Likes 0 ·
brendan avatar image brendan Matt commented ·

Yes, we have an open item to review the API calls and ensure that they all have the complete list of error codes. For LinkFacebookAccount specifically, that (NotAuthenticated) should be the only additional error code, though.

0 Likes 0 ·
Matt avatar image Matt commented ·

That sounds great, thanks a ton! I'll check for that within my ExecuteCloudScript call and any other calls (just to be safe).

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.