Xamarin Essentials is great, but Shiny makes realtime background location updates a thing on Xamarin/MAUI based platform.
Setup
Nuget
Project File (csproj)
MauiProgram.cs
AndroidManifest.xml
Apple Info.plist
Apple PrivacyInfo.xcprivacy
Shiny.Locations
Shiny.Hosting.Maui
Starting/Stopping the GPS Service
Observing in the background
First, create the delegate that implements IGpsDelegate
Controlling GPS Notification on Android
Next, let’s register that with your app builder/hosting/service collection
Lastly, last start it up
Easier Delegate
The platform mechanics don’t always play by the rules for time & distance filters that you may expect especially with a more ‘real time’ setup.
To work around these issues, you can use the GpsDelegate class which will handle the filtering for you.