You can add some custom fields (e.g. "age", "gender" and "birthday") too. You can use any field names as long as they are not predefined by the SDK. To learn more about the predefined fields, please read the Javadoc.
You will set your custom fields in the UserFields instance.
Setting and updating custom fields
The following example illustrates how to set the custom fields.
If an existing field is not explicitly specified for the update operation, the field remains unchanged on Kii Cloud.
The fields are updated on Kii Cloud and in the KiiUser instance after the update method is successfully completed.
You can update predefiend and custom fields at the same time.
Only users themselves can update their fields. See User Attributes to learn more on who can access the user's fields.
Note: The KiiUser#update() and KiiUser#update(KiiUserCallBack) methods are now deprecated. Please use the KiiUser#update(IdentityData, UserFields) or KiiUser#update(IdentityData, UserFields, KiiUserUpdateCallback) methods instead.
Getting custom fields
The following example illustrates how to get the custom fields. You need to call the getter methods that correspond to the target values. To learn more, please read the Javadoc.
To get a list of available key-value pairs, call the keySet method like the following example:
Setting custom fields upon the user registration
The following example illustrates how to set the custom fields upon the user registration.
As shown in the sample code, you can set the custom fields with the set method after creating a KiiUser instance.