Account Management - Link Game Center Account

Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account. Logging in with a Game Center ID is insecure if you do not include the optional PublicKeyUrl, Salt, Signature, and Timestamp parameters in this request. It is recommended you require these parameters on all Game Center calls by going to the Apple Add-ons page in the PlayFab Game Manager and enabling the 'Require secure authentication only for this app' option.

POST https://titleId.playfabapi.com/Client/LinkGameCenterAccount

Request Header

Name Required Type Description
X-Authorization True

string

This API requires a client session ticket, available from any Client Login function.

Request Body

Name Required Type Description
GameCenterId True

string

Game Center identifier for the player account to be linked.

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

ForceLink

boolean

If another user is already linked to the account, unlink the other user and re-link. If the current user is already linked, link both accounts

PublicKeyUrl

string

The URL for the public encryption key that will be used to verify the signature.

Salt

string

A random value used to compute the hash and keep it randomized.

Signature

string

The verification signature of the authentication payload.

Timestamp

string

The integer representation of date and time that the signature was created on. PlayFab will reject authentication signatures not within 10 minutes of the server's current time.

Responses

Name Type Description
200 OK

LinkGameCenterAccountResult

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-Authorization

This API requires a client session ticket, available from any Client Login function.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

LinkGameCenterAccountRequest
LinkGameCenterAccountResult

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

LinkGameCenterAccountRequest

Name Type Description
CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

ForceLink

boolean

If another user is already linked to the account, unlink the other user and re-link. If the current user is already linked, link both accounts

GameCenterId

string

Game Center identifier for the player account to be linked.

PublicKeyUrl

string

The URL for the public encryption key that will be used to verify the signature.

Salt

string

A random value used to compute the hash and keep it randomized.

Signature

string

The verification signature of the authentication payload.

Timestamp

string

The integer representation of date and time that the signature was created on. PlayFab will reject authentication signatures not within 10 minutes of the server's current time.

LinkGameCenterAccountResult

Error Codes

Name Code
AccountAlreadyLinked 1011
GameCenterAuthenticationFailed 1429
InvalidGameCenterAuthRequest 1428
LinkedAccountAlreadyClaimed 1012