1
Add the SDK via Swift Package Manager
In Xcode, go to File → Add Package Dependencies, paste the repository URL
https://sdk.neurofit.app/vitals-ios, and choose Up to Next Major Version starting from 1.0.0. Xcode resolves and links the NeuroFitVitals library automatically.If you manage dependencies in a Package.swift manifest instead, add the following entry to your dependencies array and include "NeuroFitVitals" in the appropriate target’s dependencies:Package.swift
The SDK binary is under 1 MB and contains no third-party analytics or tracking frameworks. It does not store images or transmit scan data off-device.
2
Add the camera permission entry to Info.plist
The SDK requires rear-camera access to capture the photoplethysmography signal from the user’s fingertip. Add the following key to your app’s
Info.plist. Apple requires a human-readable purpose string that is shown to the user in the system permission dialog.Info.plist
3
Initialize the SDK at app startup
Call
VitalsSDK.configure once before any scan is presented — the @main entry point or AppDelegate.application(_:didFinishLaunchingWithOptions:) are both suitable. Calling configure more than once is a no-op after the first successful initialization.App entry point (SwiftUI)
4
Present the scan view controller
The SDK provides a ready-made scan UI that handles finger placement guidance, countdown, and quality feedback. You can present it from UIKit or embed it in SwiftUI.
- UIKit
- SwiftUI
Instantiate
VitalsScanViewController, assign your delegate, and present it modally. The SDK manages its own navigation and dismissal.UIKit
5
Implement VitalsScanDelegate or use result closures
The delegate pattern (UIKit) and the closure API (SwiftUI) both surface the same three events: scan completion, progress updates, and errors. The example below shows the full UIKit delegate implementation.
VitalsScanDelegate
Always check
qualityTier before reading any metric values. When the tier is .withheld, the numeric fields are not populated. See Processing and Storing Vitals Scan Results for the full result model.6
Handle errors and edge cases
The SDK surfaces errors through
VitalsError. The three most common cases and their recommended responses are listed below..cameraPermissionDenied
.cameraPermissionDenied
The user denied camera access or revoked it in Settings. Display a prompt explaining why the permission is needed and direct the user to Settings → Privacy & Security → Camera to re-enable it. You can deep-link there with
UIApplication.openSettingsURLString..licenseInvalid
.licenseInvalid
The license key was rejected by the on-device validator. Verify the key in your Neurofit developer dashboard and confirm you are reading it correctly from your app configuration. This error is not recoverable at runtime without a valid key.
.scanInterrupted
.scanInterrupted
The scan was cancelled mid-session — for example, because the app moved to the background or the user navigated away. You can immediately offer a retry without any additional reset step.
.unknown
.unknown
An unexpected condition occurred that does not map to any of the named error cases. Log the error for diagnostics and surface a generic failure message to the user. If this error occurs consistently, contact support@neurofit.app with your SDK version and reproduction steps.
The Neurofit Vitals SDK requires iOS 15 or later. Update your deployment target in your Xcode project settings if needed.
