Developer Hub
SupportDashboardGuides
  • Home
  • WiFi SDK
    • Overview
    • Integrating the SDK
      • iOS
        • QuickStart
        • SDK methods
          • initC4w
          • createCustomer
          • setupCustomer
          • createWPA2EnterpriseProfile
          • createPasspointProfile
          • getCreatedWPA2EnterpriseProfiles
          • getCreatedPasspointProfiles
          • getCustomerId
          • getCustomerInfo
          • updateCustomer
          • updateCustomerInfo
          • checkIfCustomerExists
          • getListOfPolicies
          • deletePasspointProfile
          • deleteWPA2EnterpriseProfile
          • setAPIAuthParams
          • setInterlinkedC4WIMobileSDKApplications
          • getInterlinkedC4WIMobileSDKApplications
          • logout
        • Objects
          • Customer
          • CustomerDocument
          • CustomerCreateResponse
          • CustomerInfo
          • CustomerQuery
          • WPA2EnterpriseProfile
          • PasspointProfile
        • Additional features
        • Changelog
      • Android
        • QuickStart
        • SDK methods
          • initC4w
          • createCustomer
          • setupCustomer
          • createWPA2EnterpriseProfile
          • deleteWPA2EnterpriseProfile
          • createPasspointProfile
          • deletePasspointProfile
          • isPasspointSupported
          • getCustomerId
          • getCustomerInfo
          • checkIfCustomerExists
          • updateCustomer
          • updateCustomerInfo
          • getListOfPolicies
          • setAPIAuthParams
          • getCreatedWPA2EnterpriseProfiles
          • getCreatedPasspointProfile
          • setInterlinkedC4WIMobileSDKApplications
          • getInterlinkedC4WIMobileSDKApplications
          • logout
        • Objects
          • Customer
          • CustomerDocument
          • CustomerCreateResponse
          • CustomerInfo
          • CustomerQuery
          • WPA2EnterpriseProfile
          • PasspointConfiguration
        • Additional features
        • Troubleshooting
        • Changelog
      • Flutter
        • QuickStart
        • Changelog
    • User experience
    • FAQ
  • Location SDK
    • Overview
    • Integrating the SDK
      • Android
        • Quickstart
        • Project initialization
        • SDK Methods
          • Enable/Disable
          • Handling blocking issues
          • Get Device Id
          • Reset device Id
          • Locations of Interest
            • Home location
            • Work location
        • Changelog
      • iOS
        • QuickStart
        • Installation
        • Project initialization
        • SDK methods
          • Initialization
          • Enable/Disable
          • Get Device Id
          • Reset device Id
          • Locations of interest
            • Home location
            • Work location
        • Reference versions
        • Changelog iOS
      • Flutter
        • QuickStart
        • Changelog
  • Demo toolkit
    • Demo app
    • Testlab WiFi setup
  • API Reference
    • Getting started
      • Authentication
      • Contacts
      • Locations
      • Geofences
      • Devices
      • Segments
      • WiFi logs
      • Events
    • Webhooks
    • Use cases
    • Legacy APIs (v2)
  • MyApps
    • My App Intro
    • Creating Apps
      • Access Journey Apps
      • Apps for the Dasbhoard
    • MyApps APIs and SDK
      • Access Journey SDK
      • REST APIs in MyApp
      • Context APIs
    • Sample projects
      • MyApps -Js SDK boilerplate
      • Video Advertising
      • Typeform integration
      • Facebook Pixel in Acces Journey
  • Tutorials
    • Sample onboarding flow for new app users
    • Integrating WiFi SDK in Flutter apps
Powered by GitBook
On this page
  • Update the customer's attributes
  • Examples

Was this helpful?

Export as PDF
  1. WiFi SDK
  2. Integrating the SDK
  3. iOS
  4. SDK methods

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)
}
Cloud4WiSDKWiFi *cloud4WiSDKWiFi = [[Cloud4WiSDKWiFi alloc] init];
	
	Customer* customer;
	[customer setFirstName:@"Michele-edit"];
	[customer setLastName:@"Rossi-edit"];
	[customer setEmail: @"email-edit"];
	[customer setLanguage:@"en"];
	[customer setExtId: @"extId-12345677810-edit"];
	[customer setExtProp1:@"extP1-1234567789-edit"];
	[customer setExtProp2:@"extIdP2 -1234567789-edit"];
	[customer setPpd: [NSNumber numberWithBool:false]];
	[customer setProfiling:[NSNumber numberWithBool:false]];
	
	CustomerDocument* document;
	[document setPassportNumber:@""];
	[document setPersonalId:@""];
	[document setMemberId:@""];
	
	[customer setDocument:document];

	[customer setEmailVerified:false];
	
	[customer setCountry:@"US"];
	[customer setBirthDate:@"2018-12-01"];
	[customer setGender:@"M"];
	[customer setPhoneNumber:@"+391111111110000"];
	[customer setPhoneVerified:false];
	
	NSDictionary *customFields = @{@"doYouLikeBeer": @"yes", @"doYouLikeWine" : @"yes"};
	
	[customer setCustom:customFields];
	
	[cloud4WiSDKWiFi getListOfPolicies:^(NSArray<NSString *> *policies) {
		NSMutableDictionary *approvedPolicies = [[NSMutableDictionary alloc] init];
		for (NSString* policy in policies) {
			[approvedPolicies setObject:@"true" forKey:policy];
		}
		[customer setPolicies:approvedPolicies];
		
		[cloud4WiSDKWiFi updateCustomer:customer onSuccess:^(BOOL) {
			NSLog(@"INFO: Update customer success");
		} onError:^(NSError *error) {
			NSLog(@"error");
		}];
	} onError:^(NSError *error) {
		NSLog(@"error");
	}];

PreviousgetCustomerInfoNextupdateCustomerInfo

Last updated 1 year ago

Was this helpful?