> For the complete documentation index, see [llms.txt](https://freegrow-1.gitbook.io/product-docs-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://freegrow-1.gitbook.io/product-docs-en/en-mobile-kit-n1/uwb-n1-sdk/ranging-sdk/ios.md).

# iOS

**SpaceSDK-iOS** is a UWB-based iOS SDK developed by FREEGROW Inc.\
It enables easy ranging and indoor positioning using BLE + UWB communication between iOS devices and GrowSpace UWB hardware.

***

### Key Features

* BLE + UWB ranging
* RTLS-based 2D/3D positioning (x, y, z)
* Real-time connect/disconnect callback for devices
* Simple API that works with a single line of code

***

### Installation (SPM)

To install via **Swift Package Manager**, add the following link:

```
https://github.com/freegrowenterprise/SpaceSDK-iOS
```

* Xcode → File → Add Packages
* Paste the URL and choose the latest version

***

### Permission Settings (Info.plist)

```xml
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Required to scan and connect to BLE devices.</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>Required for location tracking using BLE and UWB.</string>

<key>NSNearbyInteractionUsageDescription</key>
<string>Required for distance measurement using UWB.</string>

<key>NSMotionUsageDescription</key>
<string>Motion data is required for accurate positioning.</string>

```

***

### Initialize SDK

```swift
let spaceSDK = GrowSpaceSDK()
```

***

### Start Ranging&#x20;

```swift
spaceSDK.startUWBRanging(
    maximumConnectionCount: 3,
    onUpdate: { result in
        print("Device: \(result.deviceName), Distance: \(result.distance)m")
    },
    onDisconnect: { result in
        print("Disconnected from: \(result.deviceName)")
    }
)
```

***

### Stop Ranging

```swift
spaceSDK.stopUWBRanging {
    print("✅ Ranging stopped")
}
```

***

### RTLS Positioning

```swift
let anchors = [
    "FGU-0001": (x: 0.0, y: 0.0, z: 0.0),
    "FGU-0002": (x: 5.0, y: 0.0, z: 0.0),
    "FGU-0003": (x: 0.0, y: 5.0, z: 0.0)
]

spaceSDK.startUwbRTLS(
    anchorPositions: anchors,
    onResult: { location in
        print("Current position: x=\(location.x), y=\(location.y), z=\(location.z)")
    },
    onFail: { reason in
        print("Failed to estimate position: \(reason)")
    }
)
```

***

### Test App

You can try all features of SpaceSDK-iOS using the official test app below.

* [GitHub](https://github.com/freegrowenterprise/SpaceSDK-iOS-TestApp)
* [App Store](https://apps.apple.com/us/app/space-uwb/id6745208882)
