question

programacion avatar image
programacion asked

LoginWithGameCenter not working properly

Hello,

During the last few days, I've been trying to integrate PlayFab on our game, which is made with Unity both for iOS and Android, but I'm having trouble logging in to PlayFab with GameCenter.

Here is the flow I came up with reading forum posts and etc. "Game Service" refers to either Game Center or Google Play, depending on the platform. I am experiencing unexpected behaviour on the steps labeled with "Not Working" when logging in with GameCenter on iOS.

As soon as the game launches, I check to see if the user is logged in to the Game Service. If he is not, then I login to PlayFab using the device ID. The user, however, may login to the Game Service after that for a number of reasons, once I have already logged in to PlayFab. In that case, I want to login to PlayFab using the Game Service ID instead. At this point, LoginWithGameCenter (with CreateAccount = false) does not return an error even when there is no player registered with that Game Center ID. Moreover, the call successfully logs me in to that account, which is in no way linked to the GameCenter ID. Furthermore, I then do a call to LinkGameCenterAccount (In the diagram, the one with the note "Only useful when logged in with Game Center") to avoid the problem, but still does not generate any link in the GameManager and returns successfully.

Otherwise, If they are, then LoginWithGameCenter is called with the CreateAccount flag set to true, and the device they're playing on is linked to that account using LinkDeviceID. At that point, the account is successfully created, but the link with the device won't happen. Strangely enough, when resetting the game without a GameCenter connection, calling LoginWithDeviceID successfully logins to the account created with GameCenter before.

unity3d
playfab-flow2.png (94.2 KiB)
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

Can you give us the Title ID, and the PlayFab IDs of users you've been experimenting with, so that we can have a look?

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

programacion avatar image programacion commented ·

I postponed the task for a while and, after I came back to it, I finally figured the misunderstanding was being caused because, as you said, clicking on "Delete Player" on the Game Manager does not immediately delete the player; which was causing me some pain when testing the system.

With new players it works as expected =D

Thanks for your help

1 Like 1 ·
programacion avatar image programacion commented ·

2017-08-15-11-07-49.jpg2017-08-15-11-07-49-01.jpg

Hi,

Another weird thing is that when we register a new user with a deviceID or GameCenterID and we delete it and register again, the user still has the same login log.

0 Likes 0 ·
brendan avatar image brendan programacion commented ·

Can you please provide the Title ID, and the set of repro steps, including the PlayFab IDs for those steps, so that we can have a look at this?

0 Likes 0 ·
programacion avatar image programacion commented ·

Hi,

TitleID: BBC3

PlayFabID: F03CC89662BFE52C

We also noticed that even if we delete that player, its login log (In "logins" tab) persists when making a new player with the same id. Is that normal?

captura-de-pantalla-2017-08-15-a-las-140952.pngcaptura-de-pantalla-2017-08-15-a-las-140936.png

0 Likes 0 ·
brendan avatar image brendan programacion commented ·

Just so you know, new users start with 0 reputation and their Questions/Answers are moderated, to prevent spammers from loading the forums with bogus posts. Comments go through immediately, so I'd recommend using that for follow-ups to Answers.

I'm not quite following your logic on your repro, at the top. It's literally impossible for a login call to succeed if CreateAccount is false, and the credentials are not associated with a PlayFab account. Can you provide step-by-step the API call sequence you make and the results you're seeing, so that we can be on the same page with you?

In case it helps, player deletion puts the player account in a queue for deletion - it does not immediately remove the credentials from the account, freeing them for use on another account. I have a backlog item open to clarify that in the Game Manager.

1 Like 1 ·
programacion avatar image programacion brendan commented ·

Exactly, it is impossible, so I should get a NoAccountFound error, but I don't; and in the Game Manager I don't have any players at all.

Okay, here's a pastebin to a pseudocode version of what I am doing

0 Likes 0 ·
Show more comments

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.