maui-geolocation

Provides unified geolocation APIs for .NE .T MAUI apps across Android, iOS, macOS, Windows with permission handling, cancellation tokens, mock locations, and DI-friendly service wrapper for one-shot and continuous tracking.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/snailb1007/snail-codex-skills --skill maui-geolocation-snailb1007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maui-geolocation
Source: https://github.com/snailb1007/snail-codex-skills/tree/main/skills/maui-geolocation
Command: npx skills add https://github.com/snailb1007/snail-codex-skills --skill maui-geolocation-snailb1007

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

MAUI developers often struggle to implement reliable, cross-platform geolocation with proper permission handling and lifecycle management. This Skill offers a unified API and guidance to fetch current location and track changes across Android, iOS, macOS, and Windows, reducing boilerplate and edge-case handling.

Core Features & Use Cases

  • One-shot location with cancellation support and platform nuance awareness.
  • Continuous location listening with proper start/stop lifecycle management.
  • DI-friendly service wrapper and clear permission handling guidance for robust apps.

Quick Start

Integrate Geolocation.Default into your MAUI app and request a current location with a suitable GeolocationRequest, handling cancellation and permissions as needed.

Frequently Asked Questions about maui-geolocation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get current location in a .NET MAUI app across Android and iOS?

To get current location in .NET MAUI across Android and iOS, use a unified geolocation API with a GeolocationRequest to handle cross-platform fetching, runtime permissions, and platform nuances. This ensures consistent one-shot location retrieval.

What is the best way to handle continuous location tracking in MAUI?

Continuous location tracking in MAUI requires proper start and stop lifecycle management. A DI-friendly service wrapper handles location updates listening, ensuring robust integration and preventing resource leaks when tracking is no longer active.

Do I need to manage runtime permissions separately for MAUI geolocation?

Runtime permissions for MAUI geolocation are managed through the provided API guidance. It handles permission requests for Android, iOS, macOS, and Windows, reducing boilerplate and ensuring your app requests location access correctly before fetching data.

Can I use cancellation tokens with MAUI geolocation requests?

Yes, you can use cancellation tokens with MAUI geolocation requests. The API supports cancellation token usage for one-shot location fetches, allowing you to abort pending location requests gracefully if they take too long or are no longer needed.

Does MAUI geolocation support mock-location handling for testing?

MAUI geolocation implementations include mock-location handling. This allows developers to detect or work with simulated locations during testing scenarios, ensuring robust integration and proper app behavior when receiving non-GPS location data.