<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKSmartCard/transmit(_:reply:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TKSmartCard(im)transmitRequest:reply:"
  },
  "title" : "transmit(_:reply:)"
}
-->

# transmit(_:reply:)

Transmits data in Application Protocol Data Unit (APDU) format to the Smart Card.

```
func transmit(_ request: Data, reply: @escaping @Sendable (Data?, (any Error)?) -> Void)
```

## Parameters

`request`

The APDU request data.

`reply`

- response: The APDU response data, or `nil` if communication with the Smart Card failed.
- error: Contains information about the the error preventing the transaction from being established.

    The     `NSError`     object is created in the [`TKErrorDomain`](/documentation/CryptoTokenKit/TKErrorDomain)     domain with a code in the [`TKError.Code`](/documentation/CryptoTokenKit/TKError/Code)     enumeration.

## Discussion

You should only call this method after a session to the Smart Card has been established using the [`beginSession(reply:)`](/documentation/CryptoTokenKit/TKSmartCard/beginSession(reply:)) method, and before the session is terminated using the [`endSession()`](/documentation/CryptoTokenKit/TKSmartCard/endSession()) 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)