Beacon Monitoring allows you to scan for a region of beacons while your app is in the background, but will only provide values based
exactly on the filters you have installed.
Setup
CAUTION
You are using a component that uses an Android foreground service! You must have an application icon set or a drawable resource called notification in order for this background operation to work For additional information, please read Android Foreground Services Nuget Project File (csproj) MauiProgram.cs AndroidManifest.xml Apple Info.plist Apple PrivacyInfo.xcprivacy Shiny.Beacons Shiny.Hosting.Maui
Registering a Beacon Region for Monitoring
IBeaconMonitoringManager manager ;
await manager. StartMonitoring ( new BeaconRegion (
"B9407F30-F5F8-466E-AFF9-25556B57FE6D" ,
Unregistering a Beacon Region for Monitoring
await manager. StopMonitoring ( new BeaconRegion (
"B9407F30-F5F8-466E-AFF9-25556B57FE6D" ,
Background Delegate
namespace Sample . Beacons ;
public partial class MyBeaconMonitorDelegate : IBeaconMonitorDelegate
// works with dependency injection if you need it
public async Task OnStatusChanged ( BeaconRegionState newStatus , BeaconRegion region )
// this allows you to customize the foreground service notification
public partial class MyBeaconMonitorDelegate : IAndroidForegroundServiceDelegate
public void Configure ( AndroidX . Core . App . NotificationCompat . Builder builder )
Samples