Skip to content

Geofencing

Geofencing is a very battery efficient setup for most background applications. While similar to GPS listeners, it operates

Features

  • Fallback to standard GPS when Google Play Services is not available (please make sure to read GPS documentation for additional setup)

Setup

Shiny.Locations
Shiny.Hosting.Maui

Setup

Creating a Background Listener (Delegate)

public class MyGeofenceDelegate : Shiny.Locations.IGeofenceDelegate
{
    public Task OnStatusChanged(GeofenceState newStatus, GeofenceRegion region)
    {
        // do something here - iOS only gives you about 4 seconds to finish (plus whatever it took to initialize to get here)
    }
}

Samples