Skip to main content

Customer Info

This section refers to CustomerDetail and CustomerInfo modules.

Getting the Detailed Customer Information

To get the latest updated details about the customer, you can call getCustomerDetail method.

  Amani.sharedInstance().CustomerDetail().getCustomerDetail(new CustomerDetailObserver() {
@Override
public void result(@Nullable ResCustomerDetail customerDetail, @Nullable Throwable throwable) {
//customerDetail is fetched if there is no throwable
}
});

Updating the Customer

You can just call the setInfo method as shown in the example below.

Amani.sharedInstance().CustomerInfo().setInfo("Occupation",
"City",
"Province",
"address"
);
note

All the fields in this function are optionals. If you give them null and call upload it'll remove those fields from our side.

If you don't call the upload method, it won't update.

Uploading the Updated Customer Data

After calling the setInfo, you must call the `upload to reflect the changes to our system.

    Amani.sharedInstance().CustomerInfo().upload((isSuccess) -> {
if (isSuccess) // Uploading CustomerInfo is successfull.
if (result.equals("OK")) // Pending review.
if (errors != null) if (errors.get(0) != null){
// There is an error.
}
});