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.
Service | Operation |
---|---|
identity | MERGE |
Method Parameters
Parameter | Description |
---|---|
gameCenterId | The player's game center id (use the playerID property from the local GKPlayer object) |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string gameCenterId = "someId";
_bc.IdentityService.MergeGameCenterIdentity(
gameCenterId,
SuccessCallback, FailureCallback);
const char * gameCenterId = "someId";
_bc->getIdentityService()->mergeGameCenterIdentity(
gameCenterId, this);
- (void)mergeGameCenterIdentity:(NSString *)gameCenterId
completionBlock:(BCCompletionBlock)cb
errorCompletionBlock:(BCErrorCompletionBlock)ecb
cbObject:(BCCallbackObject)cbObject;
public void mergeGameCenterIdentity(String gameCenterId, IServerCallback callback)
_bc.identity.mergeGameCenterIdentity = function(gameCenterId, callback)
var gameCenterId = "someId";
ServerResponse result = await _bc.identityService.attachFacebookIdentity(gameCenterId:gameCenterId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
// N/A
// N/A
JSON Response
{
"data": {
"profileId": "f94f7e2d-3cdd-4fd6-9c28-392f7875e9df"
},
"status": 200
}
Common Error Code
Status Codes
Code | Name | Description |
---|---|---|
40211 | DUPLICATE_IDENTITY_TYPE | Returned 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. |