Register User
For a User to perform Registration in your application, you will need to create a new Register Datasource.
Create User Register Datasource
- Create a new Register Screen.
- Add two Text Fields for email and password.
- Press the Datasource button, and then the + Create datasource button.
- Select the Kodika Server tab.
- Select the User Data Type.
- Select Register User.
- Bind the Email and Password parameters with the respective Text Fields.
- Connect at least the parameters of theOn Success response.
- Press Save.
- Close the Datasource popup.
- Add a Button and change its title to
Register
. - Create a Start a Datasource Request Event Action in the On Click Event of the Register Button and select the newly created Datasource.
Request Parameters
The email the new user will register with.
Validations:
- When Email Exists response will be called, if the email already exists in the database.
- When Invalid Email response will be called, if the email is not in a valid email address format.
Password
The password of the new user.
Validations:
- When Weak Password response will be called, if the password is less than 6 characters.
Responses
Note: If any of the validations failed, the On Success response is not called, and only the respective failure response is called.
On Success
Called when the registration of the user is successful. The new user will be automatically logged in and set as Current User.
Parameters:
- User: The newly registered user.
On Error
Called when there is an unknown error that is not handled by the other responses.
Parameters:
- Error: A text with an error message.
When Offline
Called when the user has no Internet connection.
Parameters:
- Error: A text with an error message.
When Email Exists
Called when email parameter is an email that exists in the database.
Parameters:
- Error: A text with an error message.
When Invalid Email
Called when email parameter is a wrong formatted email address.
Parameters:
- Error: A text with an error message.
When Weak Password
Called when password has less than 6 characters.
Parameters:
- Error: A text with an error message.
Datasource automation
We would suggest setting the Datasource Spinner to ON and Auto start when Screen First Loads to OFF for this request, as we want to show a spinner during the request and execute the request only when the Button is pressed.