davidortinau/maui-skills/maui-geolocation
Claude Code and agent skill by davidortinau/maui-skills
- community
Checking that the SKILL.md file is still in the repository.
Add geolocation capabilities to .NET MAUI apps using Microsoft.Maui.Devices.Sensors. Covers one-shot and continuous location, platform permissions (Android, iOS, macOS, Windows), accuracy levels, CancellationToken usage, mock-location detection, and a DI-friendly service wrapper. USE FOR: "geolocation", "GPS location", "get current location", "location permission", "continuous location", "location tracking", "GeolocationRequest", "mock location", "latitude longitude MAUI". DO NOT USE FOR: displ…
Install
npx vskill@latest install davidortinau/maui-skills/maui-geolocationSKILL.md
.NET MAUI Geolocation
Critical: Always Pass a CancellationToken
GetLocationAsync can hang indefinitely if GPS is off, the device is indoors, or permissions are in a pending state. Always set a timeout.
Accuracy vs. Battery Trade-off
Use the lowest accuracy that satisfies your feature. Higher accuracy drains battery significantly faster — especially on Android.
| Use case | Recommended accuracy | |
|---|---|---|
| City-level / weather | Lowest or Low | |
| Nearby search / store finder | Medium | |
| Turn-by-turn navigation | High or Best |
Platform Gotchas
iOS 14 reduced accuracy
Users can grant "approximate" location (accuracy > 1 km). Your app receives a location, but it may be useless for precision features.
- Check
location.Accuracy— values > 100 m likely indicate reduced precision. - Use
GeolocationRequest.RequestFullAccuracywith a key matching
NSLocationTemporaryUsageDescriptionDictionary in Info.plist to prompt for full accuracy.
Android: mock locations in security-sensitive flows
Android: Altitude 0.0 is not sea level
Some Android devices return 0.0 for Altitude when the GPS has no barometric sensor. Treat 0.0 as "unknown", not sea level.
Android 10+: background location requires separate permission
ACCESS_BACKGROUND_LOCATION must be requested separately from foreground permissions and triggers a distinct system dialog. Requesting it together with foreground permissions causes both to be denied on some devices.
GetLastKnownLocationAsync returns null
This is expected on first boot or after a location-data reset. Always fall back to GetLocationAsync:
Permissions must be requested before any geolocation call
Call Permissions.RequestAsync<Permissions.LocationWhenInUse>() first, or catch PermissionException. Calling GetLocationAsync without permission throws on some platforms and returns null on others — inconsistent behaviour across platforms.
Continuous Listening: Don't Forget to Unsubscribe
Failing to remove the LocationChanged handler when stopping causes continued GPS usage and battery drain.
Checklist
- [ ]
CancellationTokenpassed to everyGetLocationAsynccall - [ ] Accuracy level matched to feature need (not blindly set to
Best) - [ ]
GetLastKnownLocationAsyncnull-check withGetLocationAsyncfallback - [ ] Runtime permissions requested before first geolocation call
- [ ]
LocationChangedhandler removed when stopping continuous listening - [ ] Android:
ACCESS_BACKGROUND_LOCATIONrequested separately (if needed) - [ ] iOS:
NSLocationTemporaryUsageDescriptionDictionaryadded for full-accuracy prompt - [ ] Android:
IsFromMockProviderchecked in security-sensitive flows
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/maui-skills/skills/maui-geolocation/SKILL.md
Popularity
- Repository stars
- 116
- Repository forks
- 16
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 13 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davidortinau/maui-skills/maui-geolocation)