Skip to Content
ExamplesBeacon Detection

Detecting Beacons

Why beacons are important: GPS signals are unreliable indoors (blocked by building materials), making indoor navigation inaccurate. Beacons provide precise indoor positioning (1-3m accuracy) by triangulating position from multiple Bluetooth beacons placed throughout the venue.

How beacon location works: The SDK automatically combines GPS (outdoor) and beacon (indoor) location sources, prioritizing beacons when available. This provides seamless transitions between indoor and outdoor navigation.

The SDK supports beacon detection for indoor positioning. Beacons are used to provide accurate location information inside buildings.

Setting up Beacon Detection

Why simulation exists: During development, you may not have access to physical beacons. Simulation allows testing indoor location features without physical infrastructure.

// Enable beacon simulation for testing (development only) // In production, remove this and let the SDK detect real beacons automatically positionRepository.simulateBeacons(listOf( "beacon-id-1", "beacon-id-2", "beacon-id-3" )) // The position repository will automatically handle beacon detection // and provide location updates through the locatorResultFlow // Real beacons are detected automatically via Bluetooth scanning

Beacon-based Location Updates

When beacons are detected, the SDK automatically:

  1. Calculates position: Uses triangulation from multiple beacons
  2. Updates floor information: Determines which floor the user is on
  3. Provides location updates: Sends updates through the position repository
  4. Updates map display: Shows/hides the user marker based on floor matching
// Listen to location updates (including beacon-based locations) positionRepository.locatorResultFlow.collect { positionData -> positionData?.location?.let { location -> if (location.isIndoor) { println("Indoor location on floor: ${location.floor}") } else { println("Outdoor location: ${location.latitude}, ${location.longitude}") } } }
Last updated on