Skip to content

Beacons - Ranging

Beacon ranging is NOT a background operation. Beacon ranging allows you to get all information.

Setup

Shiny.Beacons
Shiny.Hosting.Maui

Scanning

This is obviously the entirely reason for beacons. Ranging is great for setup based operations on setting beacons for contextual location based operations.

IBeaconRangingManager rangingManager; // resolve it from your container or inject it
var subscription = rangingManager
.WhenBeaconRanged(new BeaconRegion(
"MyBeacons",
new Guid("00000000-0000-0000-0000-000000000000"), // your uuid
1, // OPTIONAL: major
1 // OPTIONAL: minor
))
.Subscribe(beacon =>
{
beacon.Proximity;
beacon.Major;
beacon.Minor;
});
// when you're done
subscription.Dispose();

Managed Scan

The managed scan is meant to make it easier to show scan results for beacons. It will manage things like

  • Thread safety on the list
  • Changes within the list (beacon ranges changing)
  • Removing items from the list if they have haven’t been header
  • Ensure performance by using proper buffering techniques behind the scenes
IBeaconRangingManager rangingManager;
var scanner = rangingManager.CreateManagedScan();
scanner.Start();
scanner.Dispose(); // <= make sure to dispose when you're done!

Samples