Developer Mode

1. Overview of Developer Mode

1.1. What is Developer Mode?

  • Inconvenience of the existing development process: To use the sleep analysis feature, a minimum measurement time of 20 minutes and actual sleep are required. As a result, developers need a long waiting time to check the detection results of sleep stages, and it has difficult to check the sleep analysis results in real time in the development environment.
  • The Advantages of Developer Mode: Developer Mode significantly reduces the waiting time required in the development process. It also allows you to immediately review pre-analyzed sleep results, even if it’s not an actual sleep state, greatly enhancing the efficiency of the development process.

1.2 How to use developer mode

  • It is used to shorten the waiting time for checking sleep analysis results during development.
  • It is used to quickly check the results of implementation in a short time.
  • It is used to check the data where sleep stages are detected, even without actual sleep.
  • It is used to quickly verify the normal development process.
    • Caution: In developer mode, you can check certain exception cases, but you cannot check all possible exception cases that may occur in live mode. You should check the exact exception cases in live mode.

1.3 Main Features


SDK/API features provided: You can check all methods provided by the SDK 2.2.0, and you can test in an environment identical to actual feature implementation.

  • Providing analyzed sample data: You can check the results of sleep monitoring samples that have already been analyzed (the same data is provided repeatedly).
  • Sample Code provided: You can set up and check the developer mode features through the sample code.

2. Comparison of Developer Mode Vs Live Mode

ClassificationDeveloper ModeLive Mode
FunctionalityAll the features provided in SDK 2.2.0All SDK, API features provided
Session CreationOne sleep session can be created per user (User ID
- Error return when attempting to create more than two sessions
Maintain one sleep session per user (User ID)
- When creating more than two sessions, the previous session is terminated and a new session is created
URLProvides Callback URL feature, does not provide Base URL featureProvides both Callback URL and Base URL features
Minimum Measurement Time2 minutes (Upload 4 times)20 minutes (Upload 40 times)
Upload CycleUpload every 30 seconds (calculating 30 seconds as 300 seconds)30 seconds
Callback CycleDeliver Callback Data every 30 seconds after a minimum measurement of 2 minutesDeliver Callback Data every 5 minutes (300 seconds) after a minimum measurement of 20 minutes
Analysis ResultsAfter tracking ends, the Call back Data and Report provide ‘already analyzed 8-hour sample sleep analysis data’, regardless of the measurement time (the same sample data is provided repeatedly)Providing actual sleep analysis result data

3. Call Flow

4. Setting Method

  • Set Developer Mode Flag to ‘true’ and call initAsleepConfig
Asleep.DeveloperMode.isOn = true
let userId: String?
let baseUrl: URL?
let callbackUrl: URL?
let service: String?
let delegate: AsleepConfigDelegate = self

Asleep.initAsleepConfig(apiKey: apiKey,
                        userId: userId,
                        baseUrl: baseUrl,
                        callbackUrl: callbackUrl,
                        service: service,
                        delegate: self)
Asleep.DeveloperMode.isOn = true
Asleep.initAsleepConfig(context: Context,
                        apiKey: apiKey,
                        userId: String?,
                        baseUrl: String?,
                        callbackUrl: String?,
                        service: String?,
                        asleepConfigListener: Asleep.AsleepConfigListener)