/// <summary> /// Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password /// </summary> public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, SendAccountRecoveryEmailCallback resultCallback, ErrorCallback errorCallback) { string serializedJSON = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings); Action<string,string> callback = delegate(string responseStr, string errorStr) { SendAccountRecoveryEmailResult result = null; PlayFabError error = null; ResultContainer<SendAccountRecoveryEmailResult>.HandleResults(responseStr, errorStr, out result, out error); if(error != null && errorCallback != null) { errorCallback(error); } if(result != null) { if(resultCallback != null) { resultCallback(result); } } }; PlayFabHTTP.Post(PlayFabSettings.GetURL()+"/Client/SendAccountRecoveryEmail", serializedJSON, null, null, callback); }
/// <summary> /// Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password /// </summary> public static async Task<PlayFabResult<SendAccountRecoveryEmailResult>> SendAccountRecoveryEmailAsync(SendAccountRecoveryEmailRequest request) { object httpResult = await PlayFabHTTP.DoPost(PlayFabSettings.GetURL() + "/Client/SendAccountRecoveryEmail", request, null, null); if(httpResult is PlayFabError) { PlayFabError error = (PlayFabError)httpResult; if (PlayFabSettings.GlobalErrorHandler != null) PlayFabSettings.GlobalErrorHandler(error); return new PlayFabResult<SendAccountRecoveryEmailResult> { Error = error, }; } string resultRawJson = (string)httpResult; var serializer = JsonSerializer.Create(PlayFabSettings.JsonSettings); var resultData = serializer.Deserialize<PlayFabJsonSuccess<SendAccountRecoveryEmailResult>>(new JsonTextReader(new StringReader(resultRawJson))); SendAccountRecoveryEmailResult result = resultData.data; return new PlayFabResult<SendAccountRecoveryEmailResult> { Result = result }; }
/// <summary> /// Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password /// </summary> public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, ProcessApiCallback<SendAccountRecoveryEmailResult> resultCallback, ErrorCallback errorCallback, object customData = null) { string serializedJson = SimpleJson.SerializeObject(request, Util.ApiSerializerStrategy); Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer) { ResultContainer<SendAccountRecoveryEmailResult>.HandleResults(requestContainer, resultCallback, errorCallback, null); }; PlayFabHTTP.Post("/Client/SendAccountRecoveryEmail", serializedJson, null, null, callback, request, customData); }
/// <summary> /// Forces an email to be sent to the registered email address for the user's account, with a link allowing the user to change the password /// </summary> public static void SendAccountRecoveryEmail(SendAccountRecoveryEmailRequest request, SendAccountRecoveryEmailCallback resultCallback, ErrorCallback errorCallback, object customData = null) { string serializedJson = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings); Action<CallRequestContainer> callback = delegate(CallRequestContainer requestContainer) { ResultContainer<SendAccountRecoveryEmailResult>.HandleResults(requestContainer, resultCallback, errorCallback, null); }; PlayFabHTTP.Post("/Client/SendAccountRecoveryEmail", serializedJson, null, null, callback, request, customData); }