LocationTracking 1.0.0

dotnet add package LocationTracking --version 1.0.0
                    
NuGet\Install-Package LocationTracking -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LocationTracking" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LocationTracking" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="LocationTracking" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LocationTracking --version 1.0.0
                    
#r "nuget: LocationTracking, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LocationTracking@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LocationTracking&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=LocationTracking&version=1.0.0
                    
Install as a Cake Tool

<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.

NuGet


โœจ 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

  1. Register services
using LocationTracking;

builder.Services.AddLocationTracking();
  1. Request location permissions
await Permissions.RequestAsync<Permissions.LocationAlways>();
  1. Start tracking
await _tracker.StartTrackingAsync();
  1. 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 service
  • Info.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.

๐Ÿ†˜ Troubleshooting Guide


๐Ÿ™‹ Contributing

Have an idea or bug to report? Feel free to open an issue or submit a PR!


๐Ÿ“ƒ License

MIT ยฉ

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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