Contents

CLServiceSession

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

Declaration

final class CLServiceSession

Mentioned in

Discussion

A CLServiceSession object represents your app’s current goal for location authorization (for example CLServiceSession.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 init(authorization:) or init(authorization:fullAccuracyPurposeKey:), respectively.

Topics

Creating a session

Ending the session

Getting diagnostic information

Structures

See Also

Location updates