Introduction

Asleep Track SDK is a software development kit that enables developers to create applications that monitor the sleep of users. The SDK provides tools and resources to integrate sleep-tracking features into mobile applications.

One of the primary features of the Asleep Track SDK is its ability to track the user's sleep in real time, including sleep stages and breathing stability. The SDK can gather information about the user's sleep patterns, including the amount of time spent in each stage of sleep. This information can be used to provide insights into the user's sleep quality and recommend improvements to their sleep habits.

Overall, Asleep Track SDK is a powerful tool for developers looking to create sleep-tracking applications. Asleep’s business partners only need to care about the UI/UX of their applications, and Asleep Track SDK will take care of all core functions for sleep monitoring.

With its advanced features and easy integration, it offers a comprehensive solution for developers looking to improve the sleep quality of their users.

Interfaces

2.1 Asleep.AsleepConfig

AsleepConfig contains all essential configurations, such as API key, user ID, base URL for API communications, etc.

The config is used throughout the SDK for sleep-tracking functions.

2.2 Asleep.SleepTrackingManager

SleepTrackingManager is used to maintain sleep sessions for a user ID specified in AsleepConfig.

This manager can start a sleep session, stop a sleep session, as well as retrieving the latest sleep report from a user.

2.3 Asleep.Reports

Reports manages all sleep reports of a user with a userId specified in Asleep.Config.

It can list all available sleep session IDs given a range of time, as well as retrieving a detailed sleep report given a session ID.

2.4 Asleep.AsleepErrorCode

This document describes all available error codes to help developers understand what is happening inside the SDK.

3. Version History

VersionHistory
v2.0.01. Change Reports Structure
2. User-Agent has been added to HTTP.
v2.1.01. The noise reduction processing has been modified.
v2.1.11. Modified Error handling. Audio process stop during session Open / Close error case
2. Modified Debug SDK Log
v2.1.21. Add related to TrackingStatus
2. Add defensive logic to close the session when initAsleepConfig is called during SleepTracking
v2.2.01. Add Developer Mode Function
2. Add Error Codes related to audio processing

- audioInitializationFailed, responseResult3. Add Session Object parameter in Reports.- Session: unexpectedEndTime, createdTimezone
- Stat: lightLatency, deepLatency, remLatency, unstableBreathCount, sleepCycle, sleepCycleCount, sleepCycleTime, wasoCount, longestWaso
v2.3.0Average-stats, sleep_index are added.
v.2.4.0Add snoring data in Report and Average Stats
Audio Interrupt Bug fix (Timing changes between audio-related interrupts and processing audio settings )
v.2.4.1Remove Personally Identifiable APIs (Does not need to be applied "PrivacyInfo.xcprivacy")
v2.4.2Fix sdk version debug message.
v.2.4.3Fixed Mic Recording abnormal behavior after sleeping calls
v.2.4.4Added retry logic for when the app resumes after being interrupted by the system
v.2.4.51. Added function ‘resumeTracking’ in SleepTrackingManager
2. Added Error code ‘cannotActivateInBackground’
3. Fixed issue in AVAudioEngineConfigurationChange when the app is in resumed state
4. Removed retry logic for when the app resumes after being interrupted by the system
v.2.4.6Added signing in Asleep SDK
v.2.4.7Fixed an issue where 'cannotActivateInBackground' error was being delegated when the microphone could not be reactivated after an interrupt.

What’s Next