Repository navigation
iOS Wellness Framework
The Wellness-iOS framework provides tools to integrate health scanning, vital signs monitoring, and measurement storage into your iOS applications.
The main interaction happens through the singleton WellnessHealth.shared, which exposes methods, delegates, and database access.
Wellness-iOS enables developers to:
-
Launch a scanner screen with a camera feed to capture and analyze vital signs.
-
Receive updates through delegate protocols for vital signs, measurements, and images.
-
Manage and retrieve stored measurements using an integrated database.
Before starting any measurements make sure your ConnectedCar tenant settings have configured WellnessLicenseKey. If it is not configured, please contact Scope Support. On mobile app it can be received using SDApiManager call:
SDApiManager.getMobileSettings { settings in
let wellnessLicenseKey = settings.wellnessLicenseKey
}Once you have the KEY you can create a session:
WellnessHealth.shared.createSession(with: wellnessLicenseKey)To interact with the framework:
-
Use the shared instance:
let wellness = WellnessHealth.shared
The framework communicates updates via delegate protocols. You must set these delegates to receive data and events.
public protocol WellnessHealthDelegate {
func vitalSignsChanged(vitalSigns: WellnessVitalSign)
func measurementTimerDidUpdate(to currentDuration: Int, from maximumDuration: Int)
func measurementDidChange(measurement: WellnessMeasurement)
func stateDidChange(to state: HealthSessionState)
func errorDidChange(to error: String)
func warningDidChange(to warning: String)
}Delegate Responsibilities:
-
vitalSignsChanged(vitalSigns:)– Called when new vital signs are detected. -
measurementTimerDidUpdate(to:from:)– Provides the elapsed measurement time. -
measurementDidChange(measurement:)– Called when the current measurement changes. -
stateDidChange(to:)– Updates the health session state. -
errorDidChange(to:)– Reports any errors. -
warningDidChange(to:)– Reports warnings (e.g., user feedback).
public protocol WellnessImageDelegate {
func onImageChange(image: ImageData)
}This delegate streams camera frames with metadata.
The framework stores all measurements internally.
-
Retrieve all stored measurements:
let allMeasurements = WellnessHealth.shared.getStoredMeasurements()
-
Results are returned in reverse chronological order (latest first).
Each WellnessMeasurement contains:
public var bloodPressureDiastolic: Int16
public var bloodPressureSystolic: Int16
public var hemoglobin: Double
public var hemoglobinA1C: Double
public var lfhf: Double
public var oxygenSaturation: Int16
public var pnsIndex: Double
public var pnsZone: Int16 // Recovery Ability
public var prq: Double
public var prqConfidence: Int16
public var pulseRate: Int16
public var pulseRateConfidence: Int16
public var respirationsPerMinute: Int16
public var rmssd: Int16
public var sd1: Int16
public var sd2: Int16
public var sdnn: Int16
public var sdnnConfidence: Int16
public var snsIndex: Double
public var snsZone: Int16 // Stress Response
public var stressIndex: Int16
public var stressLevel: Int16
public var timestamp: Date?
public var wellnessIndex: Int16
public var wellnessLevel: Int16
public var highBloodPressureRisk: Int16
public var highHemoglobinA1cRisk: Int16
public var meanRri: Int16
public var highFastingGlucoseRisk: Int16
public var highTotalCholesterolRisk: Int16
public var lowHemoglobinRisk: Int16
public var ascvdRisk: Double
public var heartAge: Int16Measurements can be wrapped with:
MeasurementWrapper<Any>This helper class provides:
-
getMax()– Maximum boundary for the measurement. -
getMin()– Minimum boundary for the measurement. -
level– Indicates the range level for the current value.
-
Get a valid license key from ConnectedCar tenant settings:
SDApiManager.getMobileSettings { settings in let wellnessLicenseKey = settings.wellnessLicenseKey }
-
Create a session:
WellnessHealth.shared.createSession(with: wellnessLicenseKey)
-
Initialize and configure delegates:
WellnessHealth.shared.delegate = self WellnessHealth.shared.imageDelegate = self
-
Start a scan when ready:
WellnessHealth.shared.startMeasurement()
-
Handle delegate updates to show vital signs and images.
-
Stop and clear the session when leaving the scanning screen:
WellnessHealth.shared.stopMeasurement() WellnessHealth.shared.clearSession()
-
Retrieve stored measurements (if needed).
Consolidated SDK
SmartDrive
PortalApiBase
PortalApiClient
Wellness
SBeacon
- Overview
- Installation
- Initialization
- Beacon Scanning
- Beacon Pairing
- Trip Management
- Driving Behavior
- Calibration
- Event Handling
- Data Models
- API Reference
Consolidated SPM
SDApiManager
CCFrameworkOpen
SmartDrive
SBeacon