AttachFacebookLimitedIdentity
Attach the user's Facebook Limited login credentials to the current profile.
Service | Operation |
---|---|
identity | ATTACH |
Method Parameters
Parameter | Description |
---|---|
facebookId | The facebook id of the user |
authenticationToken | The validated token from the Facebook 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 facebookId = "someFacebookId";
string authenticationToken = "someFacebookAuthToken";
_bc.IdentityService.AttachFacebooLimitedkIdentity(
facebookId,
authenticationToken,
SuccessCallback, FailureCallback);
const char * facebookId = "someFacebookId";
const char * authenticationToken = "someFacebookAuthToken";
_bc->getIdentityService()->attachFacebookLimitedIdentity(
facebookId, authenticationToken, this);
- (void)attachFacebookLimitedIdentity:(NSString *)facebookId
authenticationToken:(NSString *)token
completionBlock:(BCCompletionBlock)cb
errorCompletionBlock:(BCErrorCompletionBlock)ecb
cbObject:(BCCallbackObject)cbObject;
String facebookId = "someFacebookId";
String authenticationToken = "someFacebookAuthToken";
this; // implements IServerCallback
_bc.getIdentityService().attachFacebookLimitedIdentity(facebookId, authenticationToken, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var facebookId = "someFacebookId";
var authenticationToken = "someFacebookAuthToken";
_bc.identity.attachFacebookLimitedIdentity(facebookId, authenticationToken, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var facebookId = "someFacebookId";
var authenticationToken = "someFacebookAuthToken";
ServerResponse result = await _bc.identityService.attachFacebookLimitedIdentity(facebookId:facebookId, 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 Facebook 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 Facebook account). |