shinyorg/shiny/shiny-beacons
Claude Code and agent skill by shinyorg/shiny
- community
Checking that the SKILL.md file is still in the repository.
iBeacon and Eddystone ranging, background region monitoring, and broadcasting for .NET MAUI, iOS, Android, macOS, Windows, Linux and Blazor using Shiny.Beacons
Install
npx vskill@latest install shinyorg/shiny/shiny-beaconsSKILL.md
The same SKILL.md was published earlier as shinyorg/shiny/shiny-beacons.
Shiny Beacons
iBeacon and Eddystone ranging, background region monitoring, and broadcasting.
When to Use This Skill
Use this skill when the user needs to:
- Detect nearby iBeacons and estimate the distance to them
- Be notified when the device enters or leaves a beacon region, including in the background
- Read Eddystone UID, URL or TLM (telemetry) frames
- Turn the device itself into an iBeacon or Eddystone beacon
- Tune beacon distance/proximity accuracy
- Diagnose why beacon distances are jumping around, or why a region never fires
Library Overview
| Property | Value | |
|---|---|---|
| NuGet | Shiny.Beacons | |
| Namespace | Shiny.Beacons | |
| Platforms | iOS, Mac Catalyst, macOS, Android, Windows, Linux, Blazor WebAssembly. No tvOS target — tvOS binds no CLBeacon* type at all | |
| DI Namespace | Shiny (extension methods on IServiceCollection) | |
| Depends on | Shiny.BluetoothLE, Shiny.BluetoothLE.Hosting |
The one thing to understand first
iBeacon and Eddystone travel through different parts of a BLE advertisement, and that dictates everything else.
- iBeacon is manufacturer data under Apple's company id
0x004C. CoreBluetooth strips it
from every scan result on iOS, Mac Catalyst and macOS. There is no scan configuration that gets it back. So on Apple platforms iBeacon goes through CoreLocation and costs a location permission. Everywhere else Shiny parses the advertisement directly and it costs a Bluetooth permission.
- Eddystone is service data under UUID
0xFEAA, which CoreBluetooth passes through untouched.
It behaves identically on every platform, Apple included.
Never tell a user that an iOS app can range iBeacons over IBleManager.Scan(). It cannot.
Setup
All four accept an optional BeaconRangingOptions. AddBeaconMonitoring also wires the default repository so regions survive a process restart. On every platform the monitoring comes back up at startup on its own (Windows, Linux and Blazor restart the BLE scan as a startup task), and a monitoring scan that fails (Bluetooth switched off) is retried after RegionExitTimeout - so don't generate code that calls StartMonitoring again on launch just to resume.
On Linux or any plain-.NET host, register a IBleManager first (AddBluetoothLE() from Shiny.BluetoothLE.Linux) — the beacon registrations throw a named error if none is present.
Ranging
Ranging starts on first subscription and stops when the last subscription is disposed. It is a foreground activity — use monitoring for anything that has to work with the app closed.
ManagedBeaconScan for UI
WhenBeaconRanged emits once per advertisement, which is far too chatty to bind a list to. Use the managed scan, which keeps one entry per beacon and updates it in place:
clearTime drops beacons that stop advertising, so the list reflects what is actually in range.
Monitoring
Monitored regions are persisted and re-armed on the next launch. Monitoring reports only entry/exit — it never reports distance. Range the region in the foreground when you need that.
A region the device is already inside reports Entered right after StartMonitoring on Android and on iOS / Mac Catalyst 18+. iOS below 18 does not - call RequestState(region) there if the starting state matters. On Apple, RequestAccess() returns Restricted while only when-in-use is granted. The first upgrade request waits up to 30 seconds for the user's answer; iOS shows that prompt once, so later calls return straight away and the user has to change it in Settings.
Eddystone
Correlate a TLM frame with the beacon's UID/URL frame using frame.PeripheralId — a beacon interleaves frame types, and only the peripheral identifier ties them together.
EID frames surface their raw rotating identifier as EddystoneEidFrame.EphemeralId. Resolving one back to a registered beacon needs the deployment's identity key and the Curve25519/AES-EAX derivation from the spec, which this library does not implement.
Broadcasting
Only one advertisement runs at a time; starting a second replaces the first.
Code Generation Instructions
- Always `RequestAccess()` and check the `AccessState` before ranging, monitoring or broadcasting.
- Inject the managers (
IBeaconRangingManager,IBeaconMonitoringManager,IEddystoneScanner,
IBeaconBroadcaster) — never instantiate them.
- Dispose the ranging subscription. Ranging runs until the last subscriber goes away; leaving a
subscription alive keeps the radio (and on Apple, CoreLocation) busy.
- `BeaconRegion` requires a unique `Identifier` and a UUID.
Majoris optional;Minorrequires
Major. 0 is a legal value for both — do not treat it as "unset".
- Use `IBeaconMonitorDelegate` for background transitions, never a subscription. The app may not
be running when the transition fires.
- Bind lists through `ManagedBeaconScan`, not through raw
WhenBeaconRangedoutput. - Prefer `Beacon.Distance` over `Beacon.Rssi` in user-facing code.
Rssiis the raw single-packet
reading and is very noisy; Distance is computed from filtered signal.
- `Beacon.TxPower` is null on Apple platforms. CoreLocation never surfaces the raw advertisement.
Do not write code that requires it cross-platform.
- Do not compare `Beacon` records for identity — every observation differs in RSSI and timestamp.
Use Beacon.Identity (a BeaconIdentity of UUID/major/minor).
- Use `IBeaconPacket` (in
Shiny.BluetoothLE) to read or build a raw iBeacon payload. Never
hand-roll it with Guid.ToByteArray() or BitConverter.GetBytes() — both are little-endian and iBeacon is big-endian throughout.
Tuning distance accuracy
Everything lives on BeaconRangingOptions, passed to the Add* call:
- `PathLossDistanceEstimator` (default) —
d = 10^((txPower - rssi) / (10n)). Hardware-neutral
and predictable. Raise n towards 3-4 indoors.
- `CurveFitDistanceEstimator` — the Radius Networks/AltBeacon empirical fit. Use it for parity
with other Android beacon stacks; its constants were fitted to one specific device.
- Implement
IBeaconDistanceEstimatorfor your own model.
Scan filter (ServiceUuids)
ServiceUuids filters the BLE scan wherever beacons come from one (Android, Windows, Linux, Blazor, plain .NET); Apple platforms use CoreLocation and ignore it. An iBeacon advertises no service UUID (the region UUID is a field inside the manufacturer data, not a service UUID), so never put the region's proximity UUID here. Set it only when the beacons also advertise a vendor service UUID in the same packet — only advertisements carrying one are reported, so a beacon that sends it in a separate packet is never seen:
With no ServiceUuids, Android filters on Apple's iBeacon identifier (company 0x004C, payload starting 0x02 0x15) automatically, because Android delivers nothing from an unfiltered scan while the screen is off. Other platforms scan unfiltered. With AllowNonAppleCompanyId = true and no ServiceUuids, Android scans unfiltered too (those payloads use other company ids), so it stops while the screen is off.
Samples are always fed through a windowed trimmed-mean filter first (RssiFilter), which is what actually removes the jitter. On Apple platforms CoreLocation does its own filtering and hands back a distance directly, so the filter and estimator are bypassed there — only the thresholds apply.
Conventions
Proximity:Unknown,Immediate(<0.5m),Near(<3m),Far.BeaconRegionState:Unknown,Entered,Exited.Beacon.Distanceis metres; a negative value means unknown, not "very close".EddystoneUidis a value type;Namespaceis 20 hex chars,Instanceis 12.- Eddystone calibrates transmit power at 0 metres, iBeacon at 1 metre — a 41 dBm difference
the parser accounts for. Do not "fix" an Eddystone TxPower by comparing it to an iBeacon one.
AccessStateis from Shiny.Core:Available,Denied,Disabled,Restricted,NotSupported,Unknown.
Platform Notes
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/shiny-beacons/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shinyorg/shiny/shiny-beacons)