<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreLocation",
  "identifier" : "/documentation/CoreLocation/CLServiceSession-pt7n",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Location"
    ],
    "preciseIdentifier" : "s:12CoreLocation16CLServiceSessionC"
  },
  "title" : "CLServiceSession"
}
-->

# CLServiceSession

An object that provides diagnostics about an app’s authorization to use location services.

```
final class CLServiceSession
```

## Discussion

A `CLServiceSession` object represents your app’s current goal for location authorization (for example <doc://com.apple.documentation/documentation/CoreLocation/CLServiceSession-pt7n/AuthorizationRequirement/always>), if any. Use a `CLServiceSession` object to declaratively tell Core Location what your app needs for authorization related to a specific workflow that your app provides.

The `CLServiceSession` object requests a person’s authorization to meet those requirements if possible, including automatically re-asking as needed after temporary authorization lapses due to time your app spends in the background.

You can create and hold different session objects to request different kinds of authorization for each workflow; each of these represents an *Explicit Service Session* relevant to that workflow. Each object provides diagnostics that your app can observe to understand how its authorization state may differ from the goal it expressed.

Don’t instantiate `CLServiceSession` objects directly; instead, create an instance that specifies a particular authorization mode, or authorization mode and accuracy requirements by using <doc://com.apple.documentation/documentation/CoreLocation/CLServiceSession-pt7n/init(authorization:)> or <doc://com.apple.documentation/documentation/CoreLocation/CLServiceSession-pt7n/init(authorization:fullAccuracyPurposeKey:)>, respectively.

## Topics

### Creating a session

[`init(authorization:)`](/documentation/CoreLocation/CLServiceSession-pt7n/init(authorization:))

Creates a services session by using the authorization mode you specify.

[`init(authorization:fullAccuracyPurposeKey:)`](/documentation/CoreLocation/CLServiceSession-pt7n/init(authorization:fullAccuracyPurposeKey:))

Creates a services session by using the authorization mode and purpose key you specify.

[`AuthorizationRequirement`](/documentation/CoreLocation/CLServiceSession-pt7n/AuthorizationRequirement)

Values that describe when the service session needs to request authorization.

### Ending the session

[`invalidate()`](/documentation/CoreLocation/CLServiceSession-pt7n/invalidate())

Invalidates the services session.

### Getting diagnostic information

[`diagnostics`](/documentation/CoreLocation/CLServiceSession-pt7n/diagnostics-swift.property)

A property that describes the current state of the services session.

[`Diagnostics`](/documentation/CoreLocation/CLServiceSession-pt7n/Diagnostics-swift.class)

An object you use to access location service session diagnostic events.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)