<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SensorKit",
  "identifier" : "/documentation/SensorKit/SRSensorReader/requestAuthorization(sensors:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SRSensorReader(cm)requestAuthorizationForSensors:completion:"
  },
  "title" : "requestAuthorization(sensors:completion:)"
}
-->

# requestAuthorization(sensors:completion:)

Requests user permission to read one or more sensors.

```
class func requestAuthorization(sensors: Set<SRSensor>, completion: @escaping @Sendable ((any Error)?) -> Void)
```

```
class func requestAuthorization(sensors: Set<SRSensor>) async throws
```

## Parameters

`sensors`

One or more sensors your app requests.

`completion`

A closure to run after the framework determines user authorization.

## Discussion

Call this function for sensors in which [`authorizationStatus`](/documentation/SensorKit/SRSensorReader/authorizationStatus) is [`SRAuthorizationStatus.notDetermined`](/documentation/SensorKit/SRAuthorizationStatus/notDetermined) to display a prompt that requests user authorization. When the prompt dismisses, the framework calls the `completion` closure. Your delegate needs to wait for a call to [`sensorReader(_:didChange:)`](/documentation/SensorKit/SRSensorReaderDelegate/sensorReader(_:didChange:)) to determine whether the user approves sensor access.

If you pass a sensor into this function for which the user already answered the in-app prompt, the framework cancels the prompt with [`SRError.Code.promptDeclined`](/documentation/SensorKit/SRError/Code/promptDeclined). When the user has already answered the prompt for a particular sensor, its [`authorizationStatus`](/documentation/SensorKit/SRSensorReader/authorizationStatus) is [`SRAuthorizationStatus.authorized`](/documentation/SensorKit/SRAuthorizationStatus/authorized) or [`SRAuthorizationStatus.denied`](/documentation/SensorKit/SRAuthorizationStatus/denied). The user may change the authorization status for a sensor in Settings > Privacy > Research Sensor & Usage Data.

For more information about the authorization workflow, see [Configuring your project for sensor reading](/documentation/SensorKit/configuring-your-project-for-sensor-reading).

---

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)