Skip to main content
This document targets v0.1.13. You can check the running version with OneS1ght.sdkVersion.
OneS1ght is the single static entry point for the whole app — you never create an instance, and every API is called on the type. All APIs are called on the main actor (@MainActor).

Lifecycle

Parameters of initialize: The default baseURL is https://console.ones1ght.com/api/sdk/v1.
initialize does not look up buildings or floors. Setting the space is the job of setFloorMap — skip it and the positioning pipeline runs but produces no coordinates (E3001).

Positioning session — FloorSession

Callbacks

Session callbacks live on the FloorSession instance; the debug log lives on the OneS1ght type.
As of 0.1.12, onDebugLog gives you the level along with the text (it was (String) -> Void). See the migration guide.

LogLevel

It’s Comparable, so you can filter with level >= .warn.
“No zones registered on this floor” is a normal state — nobody has drawn a zone in the console yet — so it is .info, not a failure.
Only onTriggers comes from the server — if the network drops, the enter judgement still arrives but the triggers do not.

Space lookup

One method per endpoint, with a list and a single-item pair.

Setting the floor

Profiles

Your member IDs never reach the server — the mapping stays with you.
savedProfileId ?? (try await OneS1ght.createProfile(…)) does not compile. The right-hand side of ?? is an autoclosure and cannot carry try await — use if let instead.

Data upload

Coordinates are uploaded at 300 points or 60 seconds, whichever comes first. The remainder is also sent when the app goes to the background and on end().

State

Errors — SdkError

SdkError covers the five errors the SDK itself throws. Communication failures arrive as ApiError. Both types expose an error code through .code.
Positioning runtime errors (E4001E4003) and space setup errors (E3001E3004) are not thrown — they are logged only. Check them through onDebugLog or the console log analyzer. Full list

Models

Coordinates — live coordinates

Building · Floor

Locator · FloorLocators

Zone

These judgement parameters come from the zone metadata on the server and are set per zone in the console under Space management → select a zone → SDK zone judgement (how to set them). You can also test whether an arbitrary point is inside a zone with zone.contains(Position(x:y:)).
When inCount is 0, an enter is never confirmed and no zone event fires. New zones created in the console default to 1; if you have older zones set to 0, check them in the console.

Trigger — personalized action

MockPositioningProvider — for testing

Inject it with session.begin(provider:) to exercise the SDK pipeline without UWB. ZoneEventStatus is .enter · .dwell · .exit.

Threading

  • Every OneS1ght API is @MainActor. Call them directly from SwiftUI views and .task; from a background context, wrap them in await MainActor.run { … }.
  • Callbacks (onPosition and the rest) are also invoked on the main actor — updating the UI directly is safe.

Known limitations

UWB on iOS is foreground only. When the app goes to the background, positioning stops and the buffer is flushed; it resumes when the app comes back. This is a platform restriction the SDK cannot work around.
The coordinate buffer lives in memory. If the app is force-quit, coordinates that have not been uploaded are lost (E5006).
There is no LICENSE file yet. Terms of use follow your separate agreement.