Desk SDKs Android v1
Desk SDKs Android
Desk SDKs
Android
Version 1

Customer fields

Copy link

Customer fields enables you to save additional information of a customer, and there are two ways to save information. Information can be added by your agents on the Sendbird Dashboard or by your customers from a client app.

Note: Refer to Prerequisite before saving additional customer information.


Store additional information of a customer

Copy link

Use setCustomerCustomFields() method to let your customers add information about themselves directly from their app. The information must consist of a field and its value, and only the field already registered in Settings > Customer fields on the Sendbird Dashboard can be used.

Map<String, String> customFields = new HashMap<>();
customFields.put("gender", "female");
customFields.put("age", String.valueOf(30));

SendBirdDesk.setCustomerCustomFields(customFields, new SendBirdDesk.SetCustomerCustomFieldsHandler() {
    @Override
    public void onResult(SendbirdException e) {
        if (e != null) {
            // Handle error.
        }

        // Additional information of the customer is stored.
        // Some fields can be ignored if they aren't registered on the dashboard.
        // Values aren't saved if they don't match the data type of their fields.
    }
});