Create the Custom Fields
Create a newCustomField object passing all these 4 mandatory parameters.
- Icon: The
intthat points to the resource you want to use as Icon (keep it small). - Type: The
FieldTypeto use in this field. The type defines the keyboard layout and sometimes the input validation. - Key: The
Stringthat identifies this value in the result JSON. It shouldn’t be repeated! Repeated field keys will result in the second field getting removed from the list. - Hint: The
@StringResof the text to show as hint in the field.
Use the Custom Fields
Pass the list of custom fields to the Lock instance while you are building it, using the methodwithSignUpFields().
user_metadata attribute or are directly set in the root user profile, depending on the Storage option chosen. You can access these properties by querying the user profile at any time, even from the Dashboard in the User’s section.
Field Types
Each custom field can only have oneFieldType associated.
- TYPE_NAME
- TYPE_NUMBER
- TYPE_PHONE_NUMBER
- TYPE_EMAIL
Storage
Each custom field can only have oneStorage associated. You can choose to store it at the root level in a root profile attribute or inside the user_metadata attribute. To specify the storage location, use the five-parameter constructor and pass the Storage parameter of your choice. By default, fields will be stored inside the user_metadata attribute.
Available choices:
- PROFILE_ROOT
- USER_METADATA (default)