What’s new in location authorization

Generated on 8/7/2024

1 search

In the session titled "What’s new in location authorization" at WWDC 2024, several updates and new features were introduced for location authorization in iOS. Here are the key points:

  1. Declarative Authorization Goals:

    • The introduction of CLServiceSession allows developers to declare their authorization goals in a more streamlined and declarative manner. This helps simplify the code needed to handle location authorization.
  2. Implicit Service Sessions:

    • Modern CoreLocation APIs that provide async sequences for live updates or events can implicitly hold a CLServiceSession. This means that iterating over these sequences can automatically manage the authorization state, reducing the need for explicit authorization requests in some cases.
  3. Temporary Full Accuracy Requests:

    • If an app needs full accuracy location information temporarily (e.g., for turn-by-turn directions), it can use requestTemporaryFullAccuracyAuthorization(withPurposeKey:). This allows users to grant temporary full accuracy without changing their overall authorization settings.
  4. Always Authorization Changes:

    • Starting this year, "always" authorization will only be effective when the app is in the foreground and holds a CLServiceSession. This change aims to provide more control and transparency over when location data is accessed.
  5. Diagnostic Properties:

    • A new system of diagnostic properties provides a complete contextual understanding of the app's current authorization state and the function of any other CoreLocation API objects. This helps in better managing and debugging location authorization issues.
  6. Handling Authorization Denials:

    • The session also covers how to handle various authorization denial states, including global denials where location services are disabled system-wide.

For more detailed information, you can refer to the specific chapters in the session:

These chapters provide a comprehensive overview of the new features and improvements in location authorization.