question

bodin avatar image
bodin asked

Different between LinkGameCenterAccount and LoginWithGameCenter

Hi,

I'm trying to understand how to integrate Game Center into Playfab.
after reading the documentation, I don't understand why the API LoginWithGameCenter requires TitleId. but LinkGameCenterAccount requires GameCenterId?

compare to Facebook, both LoginWithFacebook & LinkFacebookAccount APIs require the same AccessToken.

Question 2:
also I can't find the example for Unity on how to use LinkGameCenterAccount. how can I get GameCenterId? I saw another topic to use Social.localUser.id
is this information correct?

Question 3:
Do I need to upload to App store(Testflight) to make it works, or only build from Xcode directly to device is enough?

apisAuthentication
10 |1200

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

Seth Du avatar image
Seth Du answered

What Game Center requires for authentication is not defined by PlayFab, and PlayFab will only require what Game Center needs for the authentication.

GameCenterId in LinkGameCenterAccount requestshould be equal to PlayerId in LoginWithGameCenter request. What you have mentioned “Title ID” is PlayFab Title ID, which is required for all login related API calls. To get player ID, I think you may get it from Apple Game Center SDK.

For the question 2, Social.localUser.id should return the Game Center player ID. There will be changes on the returned value, please check Apple official documentation updates.

For the question 3, since we are not expert on iOS development, I believe it will be better to find dedicated help from Apple Developer community.

10 |1200

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

bodin avatar image
bodin answered

Hi @SethDu,

thank you very much for your reply.

from you answer, let's say PlayerId is equal to GameCenterId

then why the PlayerId is not a required field for LoginWithGameCenter request?

if I leave it blank, How can Game Center know which account to be authenticate?

thanks for the answer in advance & Best regards,

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

Seth Du avatar image Seth Du ♦ commented ·

There should be an "Invalid input parameters" error reported because in fact, PlayerId is required for the authentication. I will inform the team about the confusion on the documentation.

Moreover, we highly recommend you to use RESTful API testing tools like Postman, to test PlayFab APIs, please refer to https://docs.microsoft.com/en-us/gaming/playfab/sdks/postman/.

0 Likes 0 ·
bodin avatar image bodin Seth Du ♦ commented ·

I got it now.
Thank you again for your kind response.

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.