Created
December 20, 2014 08:02
-
-
Save scionwest/1980e879910ef2f94008 to your computer and use it in GitHub Desktop.
Repository
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public async Task<OperationResult> CreateUser(string username, string email, string password) | |
| { | |
| // We have to convert the keys to camelcase for Parse. | |
| // Regular expressions weren't working. Need to revist them as this is | |
| // creating a large of garbage. | |
| //var userData = new | |
| //{ | |
| // username = username.Substring(0, 1).ToLower() + username.Substring(1), | |
| // email = email.Substring(0, 1).ToLower() + email.Substring(1), | |
| // password = password, | |
| //}; | |
| //var json = JsonConvert.SerializeObject(userData); | |
| //// Create our httpClient and post our content to the users path. | |
| //HttpClient httpClient = ParseRestHelper.CreateHttpClient(); | |
| //HttpResponseMessage response = await ParseRestHelper | |
| // .PostAsync(httpClient, "users", json); | |
| // Make sure the response codes are good. | |
| //OperationResult result = await ParseRestHelper.ValidateResponseCodes(response); | |
| //if (!result.IsSuccessful) | |
| //{ | |
| // return result; | |
| //} | |
| // Grab the session token and save it for future use. | |
| //json = await response.Content.ReadAsStringAsync(); | |
| //var returnedObject = JObject.Parse(json); | |
| //string sessionToken = returnedObject.GetValue("sessionToken") | |
| // .ToString(); | |
| //this.CurrentUser = this.CreateUserFromData(returnedObject, username, email); | |
| try | |
| { | |
| //await this.storageRepository.SaveValueByKey(tokenFilename, new KeyValuePair<string, string>(tokenKey, sessionToken)); | |
| } | |
| catch (Exception) | |
| { | |
| return new OperationResult("Phone Storage is not accessible."); | |
| } | |
| return new OperationResult(true); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment