Skip to main content
Version: 6.0.0

AttachGameCenterIdentity

Attach a Game Center identity to the current profile.

ServiceOperation
identityATTACH

Method Parameters

ParameterDescription
gameCenterIdThe user's Game Center ID — can be the PlayerId, GamePlayerId, or TeamPlayerId from the GKLocalPlayer object
timestampThe timestamp value returned as part of the identity verification signature fetch from Game Center. Required for modern Game Center verification.
publicKeyUrlThe public key URL returned as part of the identity verification signature fetch from Game Center. Required for modern Game Center verification.
signatureThe raw signature bytes returned from Game Center (via GetSignature()). Required for modern Game Center verification.
saltThe raw salt bytes returned from Game Center (via GetSalt()). Required for modern Game Center verification.
teamPlayerIdOnly required when gameCenterId is set to a value other than TeamPlayerId.

Usage

http://localhost:3000
string gameCenterId = "someId"; // PlayerId, GamePlayerId, or TeamPlayerId
ulong timestamp = 0; // from GKLocalPlayer identity verification
string publicKeyUrl = ""; // from GKLocalPlayer identity verification
byte[] signature = null; // from GKLocalPlayer GetSignature()
byte[] salt = null; // from GKLocalPlayer GetSalt()
string teamPlayerId = ""; // only if gameCenterId is not TeamPlayerId

_bc.IdentityService.AttachGameCenterIdentity(
gameCenterId, timestamp, publicKeyUrl,
signature, salt, teamPlayerId,
SuccessCallback, FailureCallback);
JSON Response
{
"status": 200,
"data": null
}
Common Error Code

Status Codes

CodeNameDescription
40211DUPLICATE_IDENTITY_TYPEReturned when trying to attach an identity type that already exists for that profile. For instance you can have only one Game Center identity for a profile.
40212MERGE_PROFILESReturned when trying to attach an identity type that would result in two profiles being merged into one (for instance an anonymous account and a Game Center account).