<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SensorKit",
  "identifier" : "/documentation/SensorKit/SRError/Code/promptDeclined",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "SensorKit"
    ],
    "preciseIdentifier" : "c:@E@SRErrorCode@SRErrorPromptDeclined"
  },
  "title" : "SRError.Code.promptDeclined"
}
-->

# SRError.Code.promptDeclined

Occurs when the user cancels the sensor approval workflow.

```
case promptDeclined
```

## Discussion

The [`requestAuthorization(sensors:completion:)`](/documentation/SensorKit/SRSensorReader/requestAuthorization(sensors:completion:)) passes this error into the completion closure if the user declines the prompt by pressing Cancel. The framework also cancels the prompt if you call this function after the user had already responded to the prompt either by approving or denying access to the argument sensors.

---

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)