<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.3.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarKey",
  "identifier" : "/documentation/CarKey/CarKeyRemoteControlSessionDelegate/remoteControlSession(_:didInvalidateWithError:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CarKey"
    ],
    "preciseIdentifier" : "s:6CarKey0aB28RemoteControlSessionDelegateP06remotedE0_22didInvalidateWithErroryAA0abcdE0C_AA0abK4CodeOtF"
  },
  "title" : "remoteControlSession(_:didInvalidateWithError:)"
}
-->

# remoteControlSession(_:didInvalidateWithError:)

Notifies your delegate object that the session become invalid
for the specified reason.

```
func remoteControlSession(_ session: CarKeyRemoteControlSession, didInvalidateWithError: CarKeyErrorCode)
```

## Parameters

`session`

The session that became invalid.

`didInvalidateWithError`

The error code that contains the reason
for the invalid session. For a list of possible values,
see [`CarKeyErrorCode`](/documentation/CarKey/CarKeyErrorCode).

## Discussion

Use this method to detect if the system invalidated the session
for any reason. The system executes this method on the dispatch
queue you specified when you started the session.

---

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)