UWB (Ultra-Wideband) Integration for Precise Indoor Positioning in Mobile Apps
GPS doesn't work indoors—known fact. Bluetooth Low Energy gives 1-3 meters accuracy at best. Wi-Fi RSSI triangulation—2-5 meters with high instability. UWB (Ultra-Wideband)—technology with 10-30 cm accuracy based on radio signal transit time measurement (Time of Flight / Two-Way Ranging). Apple embedded it in iPhone 11+ via U1 chip, giving AirTag the accuracy "your bag is there, turn right".
How UWB Works and What It Means for Developers
UWB uses impulses ~500 MHz wide in 6-8.5 GHz band. Signal transit time between two devices measured with nanosecond precision (TWR—Two-Way Ranging, or TDoA—Time Difference of Arrival). Distance calculated from time: 1 ns = ~30 cm.
For indoor positioning scenario you need anchors (anchors)—UWB beacons with known coordinates—and mobile device (tag). From measured distances to minimum 3 anchors position calculated via trilateration.
Supported Devices
iOS. Apple NearbyInteraction framework. Devices with U1/U2 chip: iPhone 11–15, iPhone SE 3rd gen, AirTag, HomePod mini 2, Apple Watch Ultra. NISession—main class. One session = one pair of devices. For positioning relative to multiple anchors—several parallel NISession.
Android. UwbManager from Jetpack Core UWB (androidx.core:core-uwb). Supported devices: Samsung Galaxy (S21 Ultra+, S22+, S23, S24, Z Fold3+), Pixel 6 Pro+, some Xiaomi. Checking support: UwbManager.isAvailable().
UWB anchors (hardware). For infrastructure positioning you need third-party anchors: Qorvo DWM3000EVB, Decawave DWM1001, Sewio RTLS, Pozyx. They communicate via IEEE 802.15.4z with SDK for configuration.
Platform Limitations
Apple Nearby Interaction—only peer-to-peer between two Apple devices or MFi-certified accessories. For infrastructure indoor positioning (anchors → phone) directly via NISession works only with Qorvo-compatible anchors through special NIConfiguration.
NISession requires NIDiscoveryToken exchange between devices beforehand—usually via Multipeer Connectivity, Bluetooth or server. After token exchange NISession.run(configuration:) starts measurements.
Practical Case: Shopping Center Navigation
Scenario: shopper looking for specific store. GPS unavailable. BLE navigation insufficient for 3-meter-wide corridors. UWB anchors installed on ceiling every 10-15 meters.
Pozyx Creator anchors (UWB, PoE, self-localization) → central Pozyx server collects positioning data → REST API returns tag device coordinates in building coordinate system.
Mobile app: on building entry device "connects" (BLE handshake for identification), then every 100-200 ms receives coordinate update via WebSocket (x, y, floor).
Coordinates overlaid on building plan (SVG floor schematics). Smooth marker movement: Kalman Filter for smoothing noisy UWB measurements. Without filter marker "jumps". Kalman filter on mobile—20-30 lines code, but noticeably improves UX.
Route navigation: A* pathfinding through passage graph (graph built from SVG schematics, forbidden zones—walls and storefronts). On deviation > 1m from route—recalculate.
Apple NearbyInteraction Integration
For device-to-device scenarios (courier → client, warehouse worker → specific pallet):
import NearbyInteraction
class UWBSession: NSObject, NISessionDelegate {
let session = NISession()
func startSession(with peerToken: NIDiscoveryToken) {
session.delegate = self
let config = NINearbyPeerConfiguration(peerToken: peerToken)
config.isCameraAssistanceEnabled = true // iOS 16+: AR overlay
session.run(config)
}
func session(_ session: NISession, didUpdate nearbyObjects: [NINearbyObject]) {
guard let peer = nearbyObjects.first else { return }
if let distance = peer.distance {
print("Distance: \(distance) m")
}
if let direction = peer.direction {
// SIMD3<Float> - direction in 3D
print("Direction: \(direction)")
}
}
}
isCameraAssistanceEnabled enables Precision Finding—AR arrow over camera shows direction to object (like AirTag Precision Finding). Requires ARKit and NSCameraUsageDescription.
Token Exchange
NIDiscoveryToken can't be created programmatically—only obtained from session.discoveryToken. For UWB session start, both devices must exchange tokens beforehand. Typical scheme: both devices publish token via Bluetooth Peripheral → scan each other → get tokens → start NISession.
CloudKit or server—for scenarios where devices aren't physically nearby on initialization.
Common Integration Issues
Multipath interference. UWB signal bounces off metal surfaces (shelves, equipment)—false distance measurements. Solution: NLOS (Non-Line-of-Sight) detection through First Path Power vs Total Received Power analysis. Pozyx and Decawave return these metrics in raw packets.
NISession suspended. iOS suspends UWB session on app backgrounding. sessionWasSuspended(_ session:) — save last position, on sessionSuspensionEnded — restart. UWB doesn't work in background—platform limitation.
Anchor calibration. Anchor coordinates in space must be measured accurately—5 cm error shifts all calculations. Self-localization anchors (Pozyx, Sewio) auto-determine coordinates on first run through UWB TWR between themselves.
Dynamic accuracy. At fast movement (> 2 m/s) TDoA systems give more errors than TWR. For pedestrians TWR with 10 Hz update sufficient.
Project Process
Scenario and equipment audit → UWB platform selection (Apple NI / Qorvo / Pozyx) → pilot on test zone with accuracy measurement → mobile app integration → Kalman filtering and navigation graph → load testing (100+ simultaneous devices) → anchor deployment.
Timeline
Apple NearbyInteraction pilot on two devices—1-2 weeks. Full indoor navigation with infrastructure anchors, Kalman filter, building map—2-4 months depending on object scale. Cost estimated after infrastructure and scenario assessment.







