Skip to main content

Setting up positioning

For everything positioning-related, see the checklist before installing the SDK.

SDK and system requirements

The OneS1ght SDK runs in the following environments.
On unsupported devices or OS versions, positioning and data collection stop, but the rest of your app keeps working normally.

1. Install the SDK

Install the OneS1ght iOS SDK.
1

Open Add Package

In Xcode, click [File] → [Add Package Dependencies…].
2

Enter the repository URL

Type the address below into the search field and click [Add Package].
Leave Dependency Rule at Up to Next Major Version0.1.0.
3

Add it to your target

Keep clicking [Add Package] to add the OneS1ght library to your app target.
4

Verify

You can confirm the OneS1ght iOS SDK under [Package Dependencies] in Xcode.
If you add it through Package.swift:

2. Request location permission

Collecting visitor movement requires permission to use the UWB chip.
First add two permission descriptions to your app target’s Info tab (or Info.plist).
Ask for location permission first.
Check the Nearby Interaction permission through the SDK.
Without Nearby Interaction permission the SDK cannot talk to the UWB modules. Check the authorization state in locationManagerDidChangeAuthorization of CLLocationManagerDelegate.
Once UWB permission is denied, the platform does not let your app ask again. To ask a second time, guide the user to Settings.

3. Initialize the SDK

Initialize the SDK when the app opens, following your app’s own lifecycle. YOUR_SDK_API_KEY is the SDK API key from the OneS1ght console, and YOUR_GEOSPACE_SDK_KEY is the GeoSpace SDK key.
Call it from the root view’s .task or from App’s init.
Log line for a successful initialization YOUR_TENANT_NAME is the organization name assigned to you by OneS1ght.

4. Connect a profile

Set the subject of your metrics so you can filter reports and define segments. There is no restriction on the attributes you attach; the first time you register a subject, the server returns a unique profile ID (profileId).
A lost profile ID cannot be recovered. The server returns the value it issued but does not keep it on your app’s behalf, so store it yourself.
If you start positioning without connecting a profile, .notIdentified (E1004) is raised and positioning does not start.

5. Select the positioning space

Choose the space you want to position the user in. In OneS1ght a tenant (organization) can have several buildings, and a building has several floors. In other words, positioning requires exactly one floor to be selected.
You can change what a floor contains in Space management in the console.
Call refreshZones to pick up the changes.

6. Register enter callbacks

You can attach events to specific zones on a floor. What the event does is entirely up to you.
Register onDebugLog before initialize so that logs from the initialization step are captured as well.

7. Start positioning

Once the floor session is ready, start positioning.

8. Stop positioning

Stop positioning when the user leaves the area. Initialization and the floor selection are kept, so you can restart at any time by calling begin again.

Full example