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.- iOS (iPhone)
- Android
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.- Swift Package Manager
- Android
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 Version — 0.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.
Package.swift:2. Request location permission
Collecting visitor movement requires permission to use the UWB chip.- iOS
- Android
First add two permission descriptions to your app target’s Info tab (or Check the Nearby Interaction permission through the SDK.
Info.plist).Ask for location permission first.
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.
- SwiftUI (Swift)
- AppDelegate (Swift)
- SceneDelegate (Swift)
- Android
Call it from the root view’s
.task or from App’s init.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).
- iOS (Swift)
- Android
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.- iOS (Swift)
- Android
You can change what a floor contains in Space management in the console.
Call refreshZones to pick up the changes.
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.- iOS (Swift)
- Android
7. Start positioning
Once the floor session is ready, start positioning.- iOS (Swift)
- Android
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 callingbegin again.
- iOS (Swift)
- Android
Full example
- iOS (Swift)
- Android