ChangeEmailIdentity
Changes email address in email identity for this player
Service | Operation |
---|---|
identity | CHANGE_EMAIL_IDENTITY |
Method Parameters
Parameter | Description |
---|---|
oldEmailAddress | Old email address |
password | Password |
newEmailAddress | New email address |
updateContactEmail | Whether to update contact email in profile |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string oldEmailAddress = "oldemail@email.com";
string authenticationToken = "password";
string newEmailAddress = "newemail@email.com";
bool updateContactEmail = true;
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};
_bc.IdentityService.ChangeEmailIdentity(oldEmailAddress, authenticationToken, newEmailAddress, updateContactEmail, successCallback, failureCallback);
const char *oldEmailAddress = "oldemail@email.com";
const char *authenticationToken = "password";
const char *newEmailAddress = "newemail@email.com";
bool updateContactEmail = true;
_bc->getIdentityService()->changeEmailIdentity(oldEmailAddress, authenticationToken, newEmailAddress, updateContactEmail, this);
NSString *oldEmailAddress = @"oldemail@email.com";
NSString *authenticationToken = @"password";
NSString *newEmailAddress = @"newemail@email.com";
bool updateContactEmail = true;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc identityService] changeEmailIdentity:oldEmailAddress
authenticationToken:authenticationToken
newEmailAddress:newEmailAddress
updateContactEmail:updateContactEmail
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String oldEmailAddress = "oldemail@email.com";
String authenticationToken = "password";
String newEmailAddress = "newemail@email.com";
boolean updateContactEmail = true;
this; // implements IServerCallback
_bc.getIdentityService().changeEmailIdentity(oldEmailAddress, authenticationToken, newEmailAddress, updateContactEmail, 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 oldEmailAddress = "oldemail@email.com";
var authenticationToken = "password";
var newEmailAddress = "newemail@email.com";
var updateContactEmail = true;
_bc.identity.changeEmailIdentity(oldEmailAddress, authenticationToken, newEmailAddress, updateContactEmail, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var oldEmailAddress = "oldemail@email.com";
var authenticationToken = "password";
var newEmailAddress = "newemail@email.com";
var updateContactEmail = true;
ServerResponse result = await _bc.identityService.changeEmailIdentity(oldEmailAddress:oldEmailAddress, authenticationToken:authenticationToken, newEmailAddress:newEmailAddress, updateContactEmail:updateContactEmail);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var oldEmailAddress = "oldemail@email.com";
var authenticationToken = "password";
var newEmailAddress = "newemail@email.com";
var updateContactEmail = true;
var identityProxy = bridge.getIdentityServiceProxy();
var postResult = identityProxy.changeEmailIdentity(oldEmailAddress, authenticationToken, newEmailAddress, updateContactEmail);
if (postResult.status == 200) {
// Success!
}
{
"service": "identity",
"operation": "CHANGE_EMAIL_IDENTITY",
"data": {
"oldEmailAddress": "oldemail@email.com",
"authenticationToken": "password",
"newEmailAddress": "newemail@email.com",
"updateContactEmail": true
}
}
JSON Response
{
"status": 200,
"data": {
}
}