updateCustomer

Update the customer's attributes

/**
 * Update existing customer.
 *
 * @param customer - Customer with all fields that needs to be updated. All customer fields except 'username', 'password' and 'lock' can be updated with this method.
 * @param onSuccess - invoked if customer successfully updated
 * @param onError - invoked if exception occurred
 *
 */
- (void) updateCustomer: (Customer*) customer
              onSuccess: (void (^)(BOOL)) onSuccess
                onError: (void (^)(NSError *error)) onError NS_SWIFT_NAME( updateCustomer(_:onSuccess:onError:) );

The attributes:

username, password, lock

are not available in customer update.

The function updates the customer created with functions createCustomer, setupCustomer and getCustomerInfo.

Examples

var customer = Customer();
customer?.firstName = "Michele-edit"
customer?.lastName = "Rossi-edit"
customer?.email = email+"edit"
customer?.language = "en"
customer?.extId="extId-12345677810-edit"
customer?.extProp1="extP1-1234567789-edit"
customer?.extProp2="extIdP2 -1234567789-edit"
customer?.ppd = false
customer?.profiling = false

let document = CustomerDocument()
document.passportNumber="PN-123456-edit"
document.personalId="personalId-123-edit"
document.memberId="memberId-123-edit"
customer?.document = document

customer?.emailVerified=false

customer?.country = "US"
customer?.birthDate = "2018-12-01"
customer?.gender = "M"
customer?.phoneNumber = "+391111111110000"
customer?.phoneVerified=false

let customFields = ["doYouLikeBeer":"yes","doYouLikeWine":"yes"]
customer?.custom = customFields

for policy in policies {
    approvedPolicies[policy] = "false"
}
customer?.policies = approvedPolicies

cloud4WiSDKWiFi.updateCustomer(customer) {_ in
    print("INFO: Update customer success")
} onError: { (error) in
    print(error)
}

Last updated