<!--
{
  "availability" : [
    "iOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AccessoryTransportExtension",
  "identifier" : "/documentation/AccessoryTransportExtension/AccessoryFeatureRuntimeSessionHandler/sessionInvalidated(error:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accessory Transport Extension"
    ],
    "preciseIdentifier" : "s:27AccessoryTransportExtension0A28FeatureRuntimeSessionHandlerP18sessionInvalidated5errorys5Error_pSg_tF"
  },
  "title" : "sessionInvalidated(error:)"
}
-->

# sessionInvalidated(error:)

Notifies the handler when its feature session ends.

```
func sessionInvalidated(error: (any Error)?)
```

## Parameters

`error`

An optional error that indicates why the session ends. A `nil` value indicates ordinary completion.

## Discussion

The framework throws [`AccessoryTransportSession.Error.unavailable`](/documentation/AccessoryTransportExtension/AccessoryTransportSession/Error/unavailable) if the device loses feature eligibility as the session runs. Release any references to the session when the system calls this method.

---

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)