Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The following app demonstrates an example of using the WiFi SDK (and the Location SDK).
The app is ready to run but you have to set your own credentials by putting them into plist file. To test the WiFi section, based on Passpoint, you have to use a physical iOS device and have an access point configured in a Cloud4Wi account.
Add pod 'c4w-wifi-sdk'
to your Podfile
and run pod install
.
https://github.com/Cloud4Wi-Create/iOS-WifiSDK-SwiftPackage
In order to connect SDK to your Cloud4Wi account, you have to specify 'clientKey' and 'clientSecret'.
You can set them in your App Info.plist file by adding two following keys:
In order to use the SDK you have to add the 'Hotspot Configuration' capability to your application
This example represents the following use-case:
Read the list of organization policies (the term "policies" is used to refer to consents and agreements that are configured on the Cloud4Wi account)
Creating new customer
Verifying customer credentials in API by retrieving customer info (optional)
Create WPA2-Enterprise Wi-Fi profile on iOS device
To track the last seen date of the customer and to keep always updated the remote push notification token (if applicable) it is necessary to call the method every time the app starts
you can put it into didFinishLaunchingWithOptions
for example
Method | Description |
---|---|
Initialize the SDK and updates certain Customer attributes at every login
Initializes the customer object in the Cloud4Wi account
Triggers the installation of a WPA2-Enterprise Wi-Fi profile in the device
Triggers the installation of a Passpoint Wi-Fi profile in the device
Returns list of WPA2-Enterprise Profiles initialized on the device
Returns list of Passpoint Profiles initialized on the device
Deletes installed WPA2Enterprise profile
Deletes installed Passpoint profile
Removes the customerId saved during the create customer, removes any reference to the customer, removes Wi-Fi profiles related to the customer
Returns the identified of the customer created/logged with Cloud4wi Wifi SDK
Retrieve customer profile by username/password
Update the Customer attributes
Create empty customer with default policies
Update a Customer metadata
Search a Customer by customer properties
Get the list of policies configured in the Cloud4Wi account
Set SDK authentication parameters
Configure the list of applications to be interlinked with the current application
Get the applications interlinked with the current one
This method initializes the customer object in the Cloud4Wi account. This method must be invoked before installing the WiFi Profile.
The customer
object is described here.
Calling this function It is equivalent to a make a login. The success of this function opens a session with the customer returned. To close the session use logout()
method.
The deduplicateAttribute
attribute is optional. If set, the system will check if an exisitng customer with a matching attribute already exists in the same Cloud4Wi account.
If a matching record exists, the createCustomer
method will override the existing matching customer attributes with the one passed in the createCustomer
(except for username, password, source
)
Pssible values of deduplicateAttribute
are:
To create a customer without any deduplication check, set deduplicateAttribute
to nil.
Username and password are credentials for the user in the c4w environment and are used for Radius authN/Z.
If username
and password
are not set in the Customer object, they are generated randomly during the customer creation and returned to the app in the CustomerCreate Response object. This auto generation of the credentials is the best way to proceed.
If the method executes with no errors, it returns the object CustomerCreateResponse
Param |
---|
Username
and password
are the WiFi credentials of a Cloud4wi customer. When you create a customer using the method createCustomer
the credentials are returned in onSuccess
in the object.
username | authorized username |
password | authorized password |
This method triggers the installation of a WPA2-Enterprise Wi-Fi profile in the device. The OS will trigger a dialog to ask the user the consent to allow such operations. See User Experience
Username
and password
are the WiFi credentials of a Cloud4wi customer. When you create a customer using the method createCustomer
the credentials are returned in onSuccess
in the CustomerCreateResponse
object.
Returns the identified of the customer created/logged with Cloud4wi Wifi SDK
Param | |
---|---|
username
authorized username
password
authorized password
It deletes the Passpoint profile installed by the app.
It deletes the WPA2 profile installed by the app.
The session is opened when one of this functionscreateCustomer,
setupCustomer
and getCustomerInfo
return success.
It deletes passpoint internet profiles installed in the device using createPasspointProfile and createWPA2EnterpriseProfile
.
The delete of the wpa2-ent profile is not supported on iOs for technical limitation, the only way to delete it is to remove the application or to forgot the wifi network.
this limitation no longer exists since SDK v 1.6.0
Variable | Description | Example |
---|---|---|
memberId
loyalty member card id
number
generic document number
personalId
id card number
type
type of document
"passport"
Note:
The attributes:
username
, password
, lock
are not available in the update customer function
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
.
In order to be able to process and profiling the customer it is necessary that the attributes profiling
and ppd
are set to true
.
Param | Format | Example |
---|---|---|
language
ISO 639-1
"it"
country
ISO 3166-1 alpha2
"IT"
birthdate
YYYY-MM-DD
"2000-12-01"
gender
{M,F,O}
"M"
phoneNumber
international prefix + number
"+39123456789"
Variable | Description | Example |
---|---|---|
Variable | Description | Example |
---|
Variable | Description | Example |
---|
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
ssid | Wi-Fi network SSID to connect to |
|
outerIdentity | The identity string to be used in the EAP-Identity/Response packet during outer EAP authentication. |
|
username | username associated to the profile |
|
trustedServerNames | An array of server certificate common name strings used to verify a server's certificate |
|
installedBy | the bundleId of the app installed the profile |
|
installed | date when the profile has been installed |
|
status | OK if customer has been created, KO otherwise |
|
generated | data when the customer has been created |
|
id | id of the customer created |
|
organizationId | organizationId owner of the customer |
|
locationId | locationId owner of the customer |
|
hotspotId | hotspotId associated to the customer (not applicable when customer is created via mobile SDK) |
username | username of the customer to access cloud4wi services |
|
password | password of the customer to access cloud4wi services |
|
mailSent | deprecated | nil |
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 |
present |
id | id of the customer created | 986a372347aac5e4a94516db835d58aa |
extId | a string value associated to the customer. Usually it is used to store an external CRM id of the customer |
Track customers profile status
fix getCreatedWPA2EnterpriseProfiles
and getCreatedPasspointProfiles
introduced deleteWPA2EnterpriseProfile
Added deletePasspointProfile
method
In the logout
are removed the Passpoint profile installed
Added method updateCustomer
Added DEBUG_MODE
Fix support iOs simulator for Apple Silicon architecture
fix date format in 'lastSeen' field
Passpoint support
New create customer function with deduplication on specific parameter
Extended support of custom policies
Note: this version has not fully compatible with version 1.1.0 (see following migration guide)
The signature of the method
has been replaced by
To create a customer without deduplication:
The signature of the method getListOfPolicies
has been replaced by
Create customer now support the attributes of the CreateCustomer API v3
WPA2-Enterprise profile creation support
Integration with Location SDK
Variable | Description | Example |
---|
realm | Passpoint home realm which will be recognized by device as home Passpoint network. |
|
friendlyName | User friendly name describing Passpoint network. |
|
roaming | It indicates if device with Passpoint profile would try to connect to 3rd party Passpoint networks. |
|
outerIdentity | The identity string to be used in the EAP-Identity/Response packet during outer EAP authentication. |
|
username | username associated to the profile |
|
trustedServerNames | An array of server certificate common name strings used to verify a server's certificate |
|
installedBy | the bundleId of the app installed the profile |
|
installed | date when the profile has been installed |
|
The debug mode allows you to have useful information on the console for debugging the application and the SDK. When enabled - SDK will print configuration parameter on startup and additional information on every API request that may help you during application development.
To enable the debug mode you have to configure this key into plist file of the app.
In DEBUG MODE sensitive informations (like customer attributes, credentials, keys ...) are written to the debug console.
To disable the DEBUG MODE before deploy/publish the application.
If you need to get the remote push notification token and associate it to a customer you have to init the SDK with the token using the method cloud4WiSDKWiFi.initC4w(token).
Cloud4WiSDKWiFi allows you to share information about installed Wi-Fi profiles among applications on same iOS device. This will help to avoid duplications of Wi-Fi profiles and make your application more flexible.
NOTE: this feature is optional, you may need it only if you integrate SDK in more than one application from your domain.
To enable interlinking you have to add App Group
capability in every application where SDK is integrated. Group name must be set to group.com.cloud4wi.sdk.wifi
:
After adding required capability you have to supply SDK with the list of interlinked applications identifiers: