LocationTracking 1.0.0
dotnet add package LocationTracking --version 1.0.0
NuGet\Install-Package LocationTracking -Version 1.0.0
<PackageReference Include="LocationTracking" Version="1.0.0" />
<PackageVersion Include="LocationTracking" Version="1.0.0" />
<PackageReference Include="LocationTracking" />
paket add LocationTracking --version 1.0.0
#r "nuget: LocationTracking, 1.0.0"
#:package LocationTracking@1.0.0
#addin nuget:?package=LocationTracking&version=1.0.0
#tool nuget:?package=LocationTracking&version=1.0.0
<img src="https://raw.githubusercontent.com/pallav1111/MauiLocationTracker/main/logo.png" alt="Logo" width="100"/>
MauiLocationTracker
A lightweight, cross-platform .NET MAUI library for tracking user location in the foreground and background on Android and iOS. Built for developers who want simple, observable, and extensible location tracking with optional logging.
โจ Features
- โ Cross-platform support (Android & iOS)
- ๐ฐ๏ธ Background location tracking (via ForegroundService on Android)
- ๐ Live location update events
- ๐ Internal logging to local file (optional)
- ๐ก Simple API via
ILocationTracker
interface - โ๏ธ Configurable tracking options: interval, accuracy, background behavior
๐ฆ Installation
dotnet add package MauiLocationTracker
Or use the NuGet Package Manager in Visual Studio.
๐ Getting Started
- Register services
using LocationTracking;
builder.Services.AddLocationTracking();
- Request location permissions
await Permissions.RequestAsync<Permissions.LocationAlways>();
- Start tracking
await _tracker.StartTrackingAsync();
- Listen to live updates
LocationEventHub.OnLocationReceived += location =>
{
Console.WriteLine($"Lat: {location.Latitude}, Lng: {location.Longitude}");
};
๐ Full docs: Getting Started
โ๏ธ Configuration
Configure the tracking via LocationTrackingOptions
:
builder.Services.AddLocationTracking(options =>
{
options.Interval = TimeSpan.FromMinutes(2);
options.Accuracy = LocationAccuracy.High;
options.EnableBackgroundTracking = true;
});
๐ See Configuration
๐ฑ Platform Setup
Make sure you configure:
AndroidManifest.xml
: location permissions + foreground serviceInfo.plist
for iOS: location background modes & usage description
๐งญ See Platform Setup Guide
๐งช Advanced Usage
- Access logged data
- Export logs
- Customize logger
๐ง Advanced Usage
๐ Troubleshooting
- App killed = background tracking stops on Android unless JobScheduler is configured.
- iOS requires correct background modes.
- Ensure permissions are requested before starting tracking.
๐ Contributing
Have an idea or bug to report? Feel free to open an issue or submit a PR!
๐ License
MIT ยฉ
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0-android35.0 is compatible. net9.0-ios18.0 is compatible. net9.0-maccatalyst18.0 is compatible. net10.0-android was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. |
-
net9.0-android35.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.6)
- Microsoft.Maui.Controls (>= 9.0.51)
- Xamarin.GooglePlayServices.Location (>= 121.3.0.6)
-
net9.0-ios18.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.6)
- Microsoft.Maui.Controls (>= 9.0.51)
-
net9.0-maccatalyst18.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.6)
- Microsoft.Maui.Controls (>= 9.0.51)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 94 | 6/27/2025 |