arrow-left

All pages
gitbookPowered by GitBook
1 of 8

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

CustomerDocument

NSString *memberId;
NSString *number;
NSString *passportNumber;
NSString *personalId;
NSString *type;
Variable
Description
Example

memberId

loyalty member card id

number

generic document number

personalId

id card number

type

type of document

"passport"

Objects

Customerchevron-right
CustomerDocumentchevron-right
CustomerCreateResponsechevron-right
CustomerInfochevron-right
CustomerQuerychevron-right
WPA2EnterpriseProfilechevron-right
PasspointProfilechevron-right

Customer

Note:

The attributes:

username, password, lock

are not available in the update customer function

hashtag
Format

Param
Format
Example

hashtag
Policies

They represent the list of the policy to apply to the customer. You can retrieve them using the function

It is mandatory that the policies returned by the function getListOfPolicies in position 0 and 1 (named "termsOfUse" and "privacy") are set to true.

hashtag
Profiling and PPD

In order to be able to process and profiling the customer it is necessary that the attributes profiling and ppd are set to true.

hashtag
Init example

NSString *username;
NSString *password;
NSString *firstName;
NSString *lastName;
NSString *phoneNumber;
NSString *email;
NSString *gender;
NSString *birthDate;
NSString *language;
NSString *country;
NSString *zipCode;
NSString *companyName;
NSString *civilStatus;
BOOL phoneVerified;
BOOL emailVerified;
NSNumber *ppd;
NSNumber *profiling;
NSDictionary *custom;
NSDictionary *policies;
CustomerDocument *document;
BOOL lock;
NSString *extId;
NSString *extProp1;
NSString *extProp2;
- (void) updateCustomer: (Customer*) customer
              onSuccess: (void (^)(BOOL)) onSuccess
                onError: (void (^)(NSError *error)) onError;

{M,F,O}

"M"

phoneNumber

international prefix + number

"+39123456789"

language

ISO 639-1

"it"

country

ISO 3166-1 alpha2

"IT"

birthdate

YYYY-MM-DD

"2000-12-01"

gender

cloud4WiSDKWiFi.getListOfPolicies
let customer = Customer()
				
let approvedPolicies = ["termsOfUse":"true", "privacy":"true"]
customer?.policies = approvedPolicies

customer?.firstName = "Michele"
customer?.lastName = "Rossi"
customer?.email = email
customer?.language = "it"
customer?.extId="extId-12345677810"
customer?.extProp1="extP1-1234567789"
customer?.extProp2="extIdP2 -1234567789"
customer?.ppd = true
customer?.profiling = true

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

customer?.emailVerified=true

customer?.country = "IT"
customer?.birthDate = "2000-12-01"
customer?.gender = "F"
customer?.phoneNumber = "+39111111122222"
customer?.phoneVerified=true

customer?.lock = false

let customFields = ["doYouLikeBeer":"no"]
customer?.custom = customFields
NSDictionary *termsAndPrivacy = @{@"termsOfUse": @"true", @"privacy" : @"true"};
Customer* customer;
[customer setPolicies:termsAndPrivacy];
	
[customer setFirstName:@"Michele"];
[customer setLastName:@"Rossi"];
[customer setEmail: @"email"];
[customer setLanguage:@"en"];
[customer setExtId: @"extId-12345677810"];
[customer setExtProp1:@"extP1-1234567789"];
[customer setExtProp2:@"extIdP2 -1234567789"];
[customer setPpd: [NSNumber numberWithBool:false]];
[customer setProfiling:[NSNumber numberWithBool:false]];	
CustomerDocument* document;
[document setPassportNumber:@""];
[document setPersonalId:@""];
[document setMemberId:@""];
	
[customer setDocument:document];

[customer setEmailVerified:true];
	
[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];

CustomerCreateResponse

Variable
Description
Example

status

OK if customer has been created, KO otherwise

{"OK","KO"}

generated

data when the customer has been created

2022-07-08T13:15:43.885Z

id

id of the customer created

hashtag
Example

output

CustomerInfo

NSString*  status;
NSString*  generated;
NSString*  id;
NSString*  extId;
Variable
Description
Example

status

OK if customer has been created, KO otherwise

{"OK","KO"}

generated

data when the customer has been created

2022-07-08T13:15:43.885Z

id

id of the customer created

PasspointProfile

Variable
Description
Example
NSString * status;
NSString * generated;
NSString * id;
NSString * organizationId;
NSString * locationId;
NSString * hotspotId;
NSString * username;
NSString * password;
NSNumber * mailSent;

986a372347aac5e4a94516db835d58aa

extId

a string value associated to the customer. Usually it is used to store an external CRM id of the customer

986a372347aac5e4a94516db835d58aa

organizationId

organizationId owner of the customer

3a8ccd060216452e09b2b32e750cb5eb

locationId

locationId owner of the customer

ff80808170f5232b01754653699e109e

hotspotId

hotspotId associated to the customer (not applicable when customer is created via mobile SDK)

username

username of the customer to access cloud4wi services

YDSDFDKJEAS

password

password of the customer to access cloud4wi services

XYXXZXYX

mailSent

deprecated

nil

cloud4WiSDKWiFi.createCustomer(customer, deduplicate: nil) { (customerResponse) in
    if let customerResponse = customerResponse {
        print(customerResponse.status)
        print(customerResponse.generated)
        print(customerResponse.id)
        print(customerResponse.organizationId)
        print(customerResponse.locationId)
        print(customerResponse.username)
        print(customerResponse.password)
        print(customerResponse.mailSent)
    }
}
[cloud4WiSDKWiFi createCustomer:customer deduplicate:nil onSuccess:^(CustomerCreateResponse *customerCreateResp) {
	NSLog(@"%@", customerCreateResp.status);
	NSLog(@"%@", customerCreateResp.generated);
	NSLog(@"%@", customerCreateResp.id);
	NSLog(@"%@", customerCreateResp.organizationId);
	NSLog(@"%@", customerCreateResp.locationId);
	NSLog(@"%@", customerCreateResp.username);
	NSLog(@"%@", customerCreateResp.password);
	NSLog(@"%@", customerCreateResp.mailSent);	
	}  onError:^(NSError *error) {
	NSLog(@"ERROR. Cannot create customer: %@", [error localizedDescription]);
}];

It indicates if device with Passpoint profile would try to connect to 3rd party Passpoint networks.

false

outerIdentity

The identity string to be used in the EAP-Identity/Response packet during outer EAP authentication.

[email protected]

username

username associated to the profile

YYYYYZZZXXX1

trustedServerNames

An array of server certificate common name strings used to verify a server's certificate

["get.securewifi.io"]

installedBy

the bundleId of the app installed the profile

com.cloud4wi.c4wiapp

installed

date when the profile has been installed

2022-07-08 08:08:44 +0000

realm

Passpoint home realm which will be recognized by device as home Passpoint network.

wifi.cloud4wi.com

friendlyName

User friendly name describing Passpoint network.

Cloud4Wi WiFi

roaming

Optional("OK") <- status
Optional("2022-07-08T13:15:43.885Z") <- generated
Optional("986a372347aac5e4a94516db835d58aa") <- id
Optional("3a8ccd060216452e09b2b32e750cb5eb") <- organizationId
Optional("ff80808170f5232b01754653699e109e") <- locationId
Optional("YDSDFDKJEAS") <- username
Optional("XXXXX") <- password
nil <- mailSent
NSString *realm;
NSString *friendlyName;
BOOL roaming;
NSString *outerIdentity;
NSString *username;
NSArray<NSString *> *trustedServerNames;
NSString *installedBy;
NSDate *installed;

CustomerQuery

NSString *cid;
NSString *username;
NSString *email;
NSString *phoneNumber;
NSString *extId;
NSString *extProp1;
NSString *extProp2;
Variable
Description
Example

cid

id of the customer

extId

a string value associated to the customer. Usually it is used to store an external CRM id of the customer

extProp1

a generic string value associated to the customer

extProp2

a generic string value associated to the customer

WPA2EnterpriseProfile

Variable
Description
Example

ssid

Wi-Fi network SSID to connect to

securewifi.io

outerIdentity

The identity string to be used in the EAP-Identity/Response packet during outer EAP authentication.

[email protected]

username

username associated to the profile

hashtag
Example

output

NSString * ssid;
NSString * outerIdentity;
NSString * username;
NSArray <NSString *> * trustedServerNames;
NSString * installedBy;
NSDate * installed;

YYYYYZZZXXX1

trustedServerNames

An array of server certificate common name strings used to verify a server's certificate

["get.securewifi.io"]

installedBy

the bundleId of the app installed the profile

com.cloud4wi.c4wiapp

installed

date when the profile has been installed

2022-07-08 08:08:44 +0000

var profiles: Array<WPA2EnterpriseProfile>
profiles = cloud4WiSDKWiFi.getCreatedWPA2EnterpriseProfiles()
var profile : WPA2EnterpriseProfile
profile = profiles[0]
print(profile.ssid)
print(profile.outerIdentity)
print(profile.username)
print(profile.trustedServerNames)
print(profile.installedBy)
print(profile.installed)
NSArray<WPA2EnterpriseProfile *> *profiles = [cloud4WiSDKWiFi getCreatedWPA2EnterpriseProfiles];
WPA2EnterpriseProfile* profile = [profiles firstObject];
NSLog(@"%@", profile.ssid);
NSLog(@"%@", profile.outerIdentity);
NSLog(@"%@", profile.username);
NSLog(@"%@", profile.trustedServerNames);
NSLog(@"%@", profile.installedBy);
NSLog(@"%@", profile.installed);
Optional("securewifi.io") <- ssid
Optional("[email protected]") <- outerIdentity
Optional("YYYYYZZZXXX1") <- username
Optional(["get.securewifi.io"]) <- trustedServerNames
Optional("com.cloud4wi.c4wiapp") <- installedBy
Optional(2022-07-08 08:08:44 +0000) <- installed