Skip to main content
Module NeurofitVitals, iOS 15 or later, Swift 5 language mode. Every public value type is Sendable and Equatable. Install it with the iOS quickstart. The optional NeurofitVitalsUI module is on Pre-built reading flow, and the Android page documents the same API in Kotlin. Minor releases may add events, enum cases and error codes. The binary is built with library evolution, so a switch over an SDK enum needs a default or @unknown default branch (Versioning).

VitalsSDK

The static entry point. There is no instance.
  • activate checks the key’s apps against Bundle.main.bundleIdentifier (Debug builds, reasons and fixes).
  • requestCameraPermission() is the one call that shows the camera prompt. iOS asks once: after an answer it returns at once, false after a refusal or under a device policy, so send the user to Settings from there (Permissions and camera).

VitalsActivation

In 1.0.0 the one warning is a key that does not list your bundle identifier, accepted because the SDK was compiled from source in Debug (Debug builds). The hosted binary is built for release, so its warnings is always empty. The result is discardable, so try VitalsSDK.activate(licenseKey: key) on its own compiles cleanly.

DeviceSupport

Device support lists the reasons and what hasTorch means.

VitalsSession

One session runs one reading. Create a new session for each reading screen.
start() throws only its preconditions: A precondition failure leaves the session idle, so call start() again once the cause is fixed. After the last two, create a new session. A camera that cannot be opened arrives as .failed(.cameraUnavailable) after start() returns (Starting a session).

VitalsEvent

When each event arrives: Events.

Guidance

The raw values are the case names. The core SDK ships no strings. The UI modules ship English defaults (VitalsStrings). Your text per value: Positioning.

CancelReason

The raw values are the case names. qualityCheckFailed comes only after .measurementComplete (Finalizing).

LivePreview and LiveSignalQuality

Live values are provisional and for display only, so store the final VitalsResult. LivePreview has no public initializer. Field meanings: Live preview.

VitalsResult, SignalQuality and BreathingRateConfidence

Codable writes and reads the canonical Result JSON, whatever your encoder’s date or data strategy (a key strategy still applies). A result built with the public initializer round-trips equal to the millisecond. Field meanings and tiers: Metrics.

VitalsError

errorDescription is a short English sentence for your logs. Match on the case, and show your own text to users.

Threading

The SDK yields events on the main thread, in order. Iterate events in a Task started from a @MainActor type, because a for await loop runs on its task’s executor. start() is @MainActor, so a main-actor caller sees it return before any event. Every other member is safe from any thread. Frame processing runs in the background and never blocks the main thread.