AttachAppleIdentity
Attach the user's Sign in with Apple credentials to the current profile.
Service | Operation |
---|---|
identity | ATTACH |
Method Parameters
Parameter | Description |
---|---|
appleId | The Apple ID of the user (i.e. the sub id from the JWT) |
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.AttachAppleIdentity(
appleId,
token,
SuccessCallback, FailureCallback);
const char * appleId = "someId";
const char * token = "someToken";
_bc->getIdentityService()->attachAppleIdentity(
appleId, token, this);
- (void)attachAppleIdentity:(NSString *)appleId
authenticationToken:(NSString *)token
completionBlock:(BCCompletionBlock)cb
errorCompletionBlock:(BCErrorCompletionBlock)ecb
cbObject:(BCCallbackObject)cbObject;
public void attachAppleIdentity(String appleId, String authenticationToken, IServerCallback callback)
_bc.identity.attachAppleIdentity = function(appleId, authenticationToken, callback)
var appleId = "someId";
var authenticationToken = "someToken";
ServerResponse result = await _bc.identityService.attachAppleIdentity(appleId:appleId, authenticationToken:authenticationToken);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
// N/A
// N/A
JSON Response
{
"status": 200,
"data": null
}
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 Apple identity for a profile. |
40212 | MERGE_PROFILES | Returned when trying to attach an identity type that would result in two profiles being merged into one (for instance an anonymous account and a Apple account). |