MergeAppleIdentity
Merge the profile associated with the provided Sigh in with Apple credentials 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 |
---|---|
appleId | The Apple ID of the user |
authenticationToken | The validated token from the Sign in with Apple SDK (that will be further validated when sent to the brainCloud service) |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string appleId = "someId";
string token = "someToken";
_bc.IdentityService.MergeAppleIdentity(
appleId,
token,
SuccessCallback, FailureCallback);
const char * appleId = "someId";
const char * token = "someToken";
_bc->getIdentityService()->mergeAppleIdentity(
appleId, token, this);
- (void)mergeAppleIdentity:(NSString *)appleId
authenticationToken:(NSString *)token
completionBlock:(BCCompletionBlock)cb
errorCompletionBlock:(BCErrorCompletionBlock)ecb
cbObject:(BCCallbackObject)cbObject;
public void mergeAppleIdentity(String appleId, String authenticationToken, IServerCallback callback)
_bc.identity.mergeAppleIdentity = function(appleId, authenticationToken, callback)
var appleUserId = "someId";
var identityToken = "someToken";
ServerResponse result = await _bc.identityService.mergeAppleIdentity(appleUserId:appleUserId, identityToken:identityToken);
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 Sign in with Apple identity for a profile. |