Sarina DuPont from Embarcadero has a new blog post in her BaaS component series for Delphi XE6 Firemonkey (previous post). In this blog post she covers how to send additional fields to the server besides the username and password on Android, IOS, and Windows (probably OSX as well). The format for the additional data is JSON and you can send as many additional fields as you need to using this method. This example uses Kinvey on the server side for accepting the signup information but you could also use Parse or any other supported provider. TBackendUsers is the component that you need to use to actually create the user account and send along the additional information. It also appears that the fields that you send along automatically get created on the server (you don’t have to create them first and then send them along as far as I can tell). You will notice how the TJSONObject component is used to automatically create the necessary JSON. Check out the sample source code and specifically the third parameter in the SignUpUser function:
procedure TSignUpForm.BtnSignUpClick(Sender: TObject);
LJSON := TJSONObject.Create;
BackendUsers1.Users.SignUpUser(EditUserName.Text, EditPassword.Text, LJSON, LLogin );
ShowMessage(’You are now signed up’);
Head over and check out the full blog post on sending extra signup data using the BaaS cloud components.
I am trying to put, and get files on Parse (eg. avatars files), do you have some example?
Just as a quick idea you can Base64 encode the file into a string and store that.
Are there any examples of doing mobile sign up & login without using baas? Maybe with datasnap?
Use the TRESTClient to do this. I use PHP and MySQL on the server side.
You just do something like
MyRESTClient.BaseURL := ‘https://myserverwhateverdomain/’;
MyRESTRequest.Execute; // or MyRESTRequest.ExecuteAsync;
if (MyRESTResponse.Content<>”) then
// do something with the content here for example parse some JSON to see if your login was successful
Here is how to do the SSL on Windows and IOS (it just works on Android):