core-location

Guide iOS 17+ Core Location authorization, monitoring, and background decisions.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/derKlinke/codex-config --skill core-location
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-location
Source: https://github.com/derKlinke/codex-config/tree/main/skills/ios-core-location
Command: npx skills add https://github.com/derKlinke/codex-config --skill core-location

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides engineers to implement robust Core Location behavior, reducing authorization mistakes, unnecessary battery drain, and background location failures.

Core Features & Use Cases

  • Authorization strategy guidance (When In Use vs Always) to balance user permission and feature needs.
  • Monitoring strategy selection (continuous, significant-change, or CLMonitor) and efficient background operation.
  • Accurate location configuration with appropriate accuracy levels and adaptive updates.
  • Geofencing and background-location patterns, with troubleshooting for common production issues.
  • Debugging and anti-pattern guidance to accelerate development and improve reliability.

Quick Start

Configure your project to adopt CLLocationUpdate and CLMonitor on iOS 17+, start with When In Use authorization, and tune accuracy for your feature. Upgrade to Always when the user enables a background feature like geofencing.

Frequently Asked Questions about core-location

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

FAQPage Schema
How do I implement background location tracking on iOS 17+ without draining battery?

Background location tracking on iOS 17+ requires using CLLocationUpdate with CLBackgroundActivitySession to maintain live updates while applying battery-optimization patterns like adaptive accuracy levels and significant-change monitoring to reduce drain.

When should I request Always authorization instead of When In Use for geofencing?

Always authorization is required for background location features like geofencing, whereas When In Use authorization suffices for foreground-only location access, balancing user permission with feature needs.

What is the best way to monitor geofences on iOS 17 and newer?

Geofencing on iOS 17+ is best implemented using the modern CLMonitor API to define and monitor geographic regions, replacing legacy CLLocationManager approaches for more efficient and reliable monitoring.

Does this Core Location guidance apply to apps targeting older iOS versions like iOS 14?

Yes, this guidance covers legacy CLLocationManager implementations for iOS 14 through 16, while providing modern CLLocationUpdate and CLMonitor patterns specifically for iOS 17 and later.

Why does continuous background location monitoring fail in my iOS app?

Continuous background location failures often stem from incorrect authorization strategies, missing CLBackgroundActivitySession configurations, or utilizing deprecated CLLocationManager patterns instead of modern CLLocationUpdate APIs.

How do I configure adaptive location accuracy levels to prevent excessive battery drain?

Adaptive location accuracy is configured by tuning CLLocationUpdate parameters to match feature requirements, lowering accuracy levels during background states or significant-change intervals to optimize battery usage.