iOS Release Notes
Version 1.4.0
New Features
- Telemetry options:
initialize(...)accepts atelemetry: TelemetryConfigparameter with two independent switches,analyticsanderrorReporting, putting the telemetry the SDK sends under your app's control.
API Changes
- Added
telemetry: TelemetryConfigparameter toinitialize(...), defaulting toTelemetryConfig(analytics: false, errorReporting: true).
Improvements
- Various bug fixes and improvements.
Version 1.3.2
Bug fixes and improvements.
Version 1.3.1
Improvements
- Sleep score stability: Fixed a crash in
AnalysisResult.toSleepScoreHistoryEntry()andSleepScoring.compute(...)for short sessions where no sleep was detected. - Various bug fixes and improvements.
Version 1.3.0
New Features
- Slim SDK variant: The Swift package now vends a second product,
SleepCycleSDKSlim, which ships without the embedded ML models and downloads the ones your granted features require on the firstinitialize(...), taking the framework embedded in your app from roughly 16 MB to roughly 1.6 MB. Both products vend theSleepCycleSDKmodule, so switching between them takes no code changes. See the Installation section of the iOS guide. - Download progress:
initialize(...)accepts anonDownloadProgresscallback reporting model download progress in0...1. - Updating the smart alarm during a session:
updateSmartAlarm(config:)replaces the alarm on the active session, adds one to a session started without an alarm, or cancels it when passednil. - Clearing persisted state:
SleepCycleSdk.clear()deinitializes the SDK and wipes the cached authorization token and any downloaded models. - Discarding resumable sessions:
clearActiveSessions()ends the sessionsresumeAnalysis(...)would pick up, makingisResumePossible()returnfalseagain.
API Changes
- Added
onDownloadProgress: (@Sendable (Double) -> Void)?parameter toinitialize(...), which now blocks until the models required by the granted features are available locally. - Added
SleepCycleSdkErrorcases for resource provisioning:.resourceUnavailable(_:),.resourceDownloadFailed(_:),.modelUnavailable(_:),.modelNotProvisioned(_:), and.modelIntegrityCheckFailed(_:). startMultiChannelAnalysis(...)now throwsSleepCycleSdkError.invalidInputwhen asmartAlarmConfigis given for a channel other than.primary.deinitialize()no longer ends active sessions. It stops the data source and leaves them resumable viaresumeAnalysis(...).
Improvements
- Various bug fixes and improvements.
Version 1.2.1
Improvements
- Improved audio classification: Updated audio classification model for improved sound detection.
Version 1.2.0
New Features
- Smart alarm: Configure a wake-up window via
SmartAlarmConfigand observe alarm lifecycle events through the newsmartAlarmStream: AsyncStream<SmartAlarmEvent>. Event types are.armedand.triggered(reason), with reasons.optimalWakeUp,.userInteraction, and.windowEnd. Smart alarm is gated behind thesmartAlarmfeature and only supported on the primary channel. - Stereo channel separation: New
ChannelSeparationConfigcontrols how stereo audio channels are assigned to analysis channels, with built-in presets.bedSideMics,.centeredMicArray, and.detectionStrengthOnly. - Configurable audio input: New
AudioInputConfigselects the audio format (mono/stereo) and a preferred input device when creating a live data source viacreateLiveDataSource(audioConfig:). - Sleep score: Compute a per-night sleep score with
SleepScoring.compute(result:history:dateOfBirth:chronoType:), which returns aSleepScorewithtotal,duration,quality, androutinesubscores (each 0.0–1.0). Build history entries from a completed result viaAnalysisResult.toSleepScoreHistoryEntry()and derive the user'sChronoTypewithSleepScoring.identifyChronoType(history:). - Extended audio events: New
extendedAudioEventsfeature flag exposes additionalEventTypevalues beyond the standard set.EventType.standardTypesandEventType.extendedTypesgroup the available sets. - Real-time sleep staging in results:
AnalysisResultnow includesrealTimeSleepStageIntervals, the sleep stages emitted live during the session (in addition to the post-sessionsleepStageIntervals).
API Changes
- The channel-aware start method is now
startMultiChannelAnalysis(channel:config:at:smartAlarmConfig:tag:)and accepts asmartAlarmConfig:parameter. stopAnalysis(channel:)is nowstopAnalysis(sessionId:), stopping a session by itsUUID.resumeAnalysis()now returns[ResumedSession](session ID, channel, and smart alarm config per resumed session) instead of[AnalysisChannel: UUID].- Added
forceTokenRefresh: Boolparameter toinitialize()to force a fresh token fetch even if a cached token exists. - Added
channelSeparationConfig: ChannelSeparationConfigparameter tostartAnalysis(...),startDataSource(...), andresumeAnalysis(...). AudioEventListener.onAudioAnalysisBatchCompleted(...)now receivesaudioProbability: [EventType: Float], the per-batch probability for each event type. Therms: [Float]parameter has been replaced bydbSpl: [Float], providing A-weighted sound volume in dB SPL.EventEndedInfonow includes aneventType: EventTypeproperty.AnalysisResultnow includestimeZone: TimeZone(captured at session start) andrealTimeSleepStageIntervals: [SleepStageInterval].- The stream accessors (
eventStream,breathingRateStream,errorStream,sleepStageStream,audioHealthStream,stateStream) andcurrentStateare nowasync(get async). - Renamed
SleepCycleSdkError.sessionAlreadyRunningto.channelAlreadyRunning, and added.featureNotEnabled(_:). - Added
SleepCycleSdk.versionreturning the SDK version string.
Version 1.1.0
New Features
- Multi-channel analysis: Analyze two channels simultaneously using stereo audio. New
startDataSource(using:eventListeners:)/stopDataSource()methods separate the data source lifecycle from session lifecycles, with per-channel start viastartAnalysis(channel:config:at:tag:)and per-session stop viastopAnalysis(channel:at:). - Audio health monitoring: New
audioHealthStream: AsyncStream<AudioHealthUpdate>emits real-time audio input health status changes (.healthy,.flatline,.missingInput).AudioStatisticsandAudioHealthIntervalare included in the analysis result. - Session IDs on all public types:
Event,BreathingRate,SleepStageInterval,AudioClip, andAudioHealthUpdatenow include asessionId: UUIDproperty to identify which session they belong to.
API Changes
startAnalysis()now returns aUUIDidentifying the session.- Added
tag: String?parameter tostartAnalysis()for labeling sessions. AudioEventListener.onAudioAnalysisBatchCompleted()now includes asessionId: UUIDparameter.AnalysisResultnow includessleepStageIntervals,audioStatistics, andsessionIdproperties.- Added
multiChannelAnalysistoSleepAnalysisFeatures.