Plugin.Maui.GeoLocator 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Plugin.Maui.GeoLocator --version 1.0.2
                    
NuGet\Install-Package Plugin.Maui.GeoLocator -Version 1.0.2
                    
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="Plugin.Maui.GeoLocator" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.Maui.GeoLocator" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.Maui.GeoLocator" />
                    
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 Plugin.Maui.GeoLocator --version 1.0.2
                    
#r "nuget: Plugin.Maui.GeoLocator, 1.0.2"
                    
#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 Plugin.Maui.GeoLocator@1.0.2
                    
#: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=Plugin.Maui.GeoLocator&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.Maui.GeoLocator&version=1.0.2
                    
Install as a Cake Tool

Plugin.Maui.GeoLocator

NuGet

A .NET MAUI plugin for Android and iOS that provides:

  • On-demand location retrieval
  • Start / stop location tracking
  • Reverse geocoding
  • Optional logging

Install

Package: https://www.nuget.org/packages/Plugin.Maui.GeoLocator

dotnet add package Plugin.Maui.GeoLocator

Or reference the project:

<ProjectReference Include="..\src\Plugin.Maui.GeoLocator\Plugin.Maui.GeoLocator.csproj" />

Host app setup

Android

Declare location permissions in Platforms/Android/AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

iOS

Add usage descriptions to Platforms/iOS/Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs your location to show where you are.</string>

For background tracking, also add always-authorization text and the location background mode.

Register the plugin

builder
    .UseMauiApp<App>()
    .UseGeoLocator(options =>
    {
        options.EnableLogging = true;
    });

Resolve IGeoLocator from dependency injection, or use GeoLocator.Current.

Usage

On-demand location

var location = await GeoLocator.Current.GetCurrentLocationAsync(new LocationRequest
{
    Accuracy = LocationAccuracy.Best,
    Timeout = TimeSpan.FromSeconds(20)
});

Last cached fix:

var last = await GeoLocator.Current.GetLastKnownLocationAsync();

Start and stop tracking

var locator = GeoLocator.Current;

locator.LocationChanged += (_, e) =>
{
    var position = e.Location;
};

locator.LocationError += (_, e) =>
{
    Console.WriteLine(e.Message);
};

await locator.StartTrackingAsync(new TrackingOptions
{
    Accuracy = LocationAccuracy.High,
    MinimumTime = TimeSpan.FromSeconds(2),
    MinimumDistanceMeters = 5
});

await locator.StopTrackingAsync();

Reverse geocoding

var addresses = await GeoLocator.Current.ReverseGeocodeAsync(
    latitude: 47.6062,
    longitude: -122.3321);

foreach (var address in addresses)
    Console.WriteLine(address.FormattedAddress);

Logging

GeoLocator.Current.EnableLogging(true);
GeoLocator.Current.EnableLogging(true, new DebugGeoLocatorLogger());
GeoLocator.Current.EnableLogging(false);

When UseGeoLocator(options => options.EnableLogging = true) is used, the plugin also writes through ILogger if the host app registered one (for example builder.Logging.AddDebug()).

Sample

samples/GeoLocator.Sample is a MAUI app that exercises all four features. Deploy it to an Android emulator/device or an iOS simulator/device with location enabled.

dotnet build src/Plugin.Maui.GeoLocator/Plugin.Maui.GeoLocator.csproj
dotnet build samples/GeoLocator.Sample/GeoLocator.Sample.csproj -f net10.0-android

Notes

  • Tracking is designed for foreground use. Android background tracking requires a host-app foreground service. iOS background tracking requires AllowBackgroundUpdates = true plus the location background mode.
  • The plugin requests when-in-use location permission at runtime.
  • net10.0 is included so shared code can reference the package. Location APIs throw GeoLocatorException (FeatureNotSupported) on that target.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-android36.0 is compatible.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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.8 90 8/30/2026
1.0.7 88 8/30/2026
1.0.6 90 8/29/2026
1.0.5 90 8/28/2026
1.0.4 81 8/28/2026
1.0.3 86 8/28/2026
1.0.2 98 8/27/2026
1.0.1 86 8/27/2026
1.0.0 86 8/27/2026