Skip to main content
Version: 6.0.0

MergeGameCenterIdentity

Merge the profile associated with the specified Game Center identity with the current profile.

NOTE: If using the BrainCloudWrapper, once the merge is complete you should call SetStoredProfileId in the BrainCloudWrapper with the profileId returned in the Merge call.

ServiceOperation
identityMERGE

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.MergeGameCenterIdentity(
gameCenterId, timestamp, publicKeyUrl,
signature, salt, teamPlayerId,
SuccessCallback, FailureCallback);
JSON Response
{
"data": {
"profileId": "f94f7e2d-3cdd-4fd6-9c28-392f7875e9df"
},
"status": 200
}
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.