AttachNonLoginUniversalId
Attaches a UniversalId to the current profile with no login capability.
Useful if the app is not using UniversalId for authentication, and you still want to attach a UniversalId to create an app-unique display name for the user.
The call will fail if the UniversalId is already in use, or if the profile already contains a UniversalId.
| Service | Operation |
|---|---|
| identity | ATTACH_NONLOGIN_UNIVERSAL |
Method Parameters
| Parameter | Description |
|---|---|
| externalId | The user's user ID |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string externalId = "username";
_bc.IdentityService.AttachNonLoginUniversalId(
externalId,
SuccessCallback, FailureCallback);
const char * externalId = "username";
const char * token = "someToken";
_bc->getIdentityService()->attachNonLoginUniversalId(
externalId, this);
NSString *externalId = @"username";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc identityService] attachNonLoginUniversalId:externalId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String externalId = "username";
this; // implements IServerCallback
_bc.identity.attachNonLoginUniversalId(externalId, 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 externalId = "username";
_bc.identity.attachNonLoginUniversalId(externalId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var externalId = "username";
ServerResponse result = await _bc.identityService.attachNonLoginUniversalId(externalId:externalId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var externalId = "username";
var identityProxy = bridge.getIdentityServiceProxy();
var postResult = identityProxy.attachNonLoginUniversalId(externalId);
if (postResult.status == 200) {
// Success!
}
{
"service": "identity",
"operation": "ATTACH_NONLOGIN_UNIVERSAL",
"data": {
"externalId": "username"
}
}
JSON Response
{
"status" : 200,
"data" : null
}