SDK Customisation

SDK Customisation

All SDK configuration goes through PageSenseSDKOptions. Set your options before passing the object into createNewPageSenseClient().

Initialization with custom options  

  1. swift
  2. import PageSenseFramework

  3. let sdkOptions = PageSenseSDKOptions()
  4. sdkOptions.logLevel = .DEBUG
  5. sdkOptions.pollingInterval = 10 // in minutes

  6. PageSense.shared.createNewPageSenseClient(
  7.     sdkAccountIDForDC: "YOUR_ACCOUNT_ID",
  8.     sdkKey: "YOUR_SDK_KEY",
  9.     projectname: "YOUR_PROJECT_NAME",
  10.     sdkOptions: sdkOptions
  11. ) { client in
  12.     if client != nil {
  13.         print("PageSense SDK initialised with custom options")
  14.     } else {
  15.         print("Initialization failed")
  16.     }
  17. }

Defaults (when no options are passed)  

Setting

Default

Description

Polling Interval

5 minutes

How often the SDK checks PageSense for updated settings.

Log Level

INFO

Captures INFO, WARN, and ERROR messages.

These defaults work for most standard iOS integrations.

Polling Interval  

Controls how often the SDK checks the PageSense server for configuration updates.

Property  

  1. swift
  2. let sdkOptions = PageSenseSDKOptions()
  3. sdkOptions.pollingInterval = intervalInMinutes

Parameter  

Parameter
Type
Description
intervalInMinutes
Int
Polling frequency in minutes. Minimum value is 5 minutes.

Example  
  1. swift
  2. let sdkOptions = PageSenseSDKOptions()
  3. sdkOptions.pollingInterval = 10 // Poll every 10 minutes
Things to watch:
  • Under 5 minutes — not allowed; automatically set to 5 minutes. Frequent polling increases network usage and battery drain.
  • Over 15 minutes — configuration changes take longer to reach the app. Users may see outdated experiment behaviour.
  • 5–10 minutes works well for most production apps.

Log Level  

Controls how much the SDK logs. Set a higher verbosity during development; dial it back for production.

Property  

  1. swift
  2. let sdkOptions = PageSenseSDKOptions()
  3. sdkOptions.logLevel = .DEBUG

Supported levels  

TRACE · DEBUG · INFO · WARNING · ERROR · FATAL
Example  
  1. swift
  2. let sdkOptions = PageSenseSDKOptions()
  3. sdkOptions.logLevel = .DEBUG
DEBUG captures everything from DEBUG upward — useful during integration, validation, and QA. In production, drop it to .info or .error to avoid excessive output.





We’ve designed this documentation to guide you every step of the way. If you need further assistance or have any questions, don’t hesitate to contact us at support@zohopagesense.com - we’re always here to help!