<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreNFC",
  "identifier" : "/documentation/CoreNFC/NFCISO7816Tag/sendCommand(apdu:resultHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core NFC",
      "CoreNFC"
    ],
    "preciseIdentifier" : "s:So13NFCISO7816TagP7CoreNFCE11sendCommand4apdu13resultHandlerySo0A4APDUC_ys6ResultOyAC0a8ResponseJ0Vs5Error_pGctF"
  },
  "title" : "sendCommand(apdu:resultHandler:)"
}
-->

# sendCommand(apdu:resultHandler:)

Sends an application protocol data unit (APDU) to the tag and receives a response APDU.

```
@preconcurrency func sendCommand(apdu: NFCISO7816APDU, resultHandler: @escaping @Sendable (Result<NFCISO7816ResponseAPDU, any Error>) -> Void)
```

## Parameters

`apdu`

An application protocol data unit to send to the tag.

`resultHandler`

A handler that the reader session invokes after the operation completes. The handler receives a <doc://com.apple.documentation/documentation/Swift/Result> with the cases:

- `success`: A instance of [`NFCISO7816ResponseAPDU`](/documentation/CoreNFC/NFCISO7816ResponseAPDU) containing the response from the tag.
- `failure`: An <doc://com.apple.documentation/documentation/Swift/Error> object indicating that a communication issue with the tag occurred.

## Discussion

When you send a `SELECT` command with a [`p1Parameter`](/documentation/CoreNFC/NFCISO7816APDU/p1Parameter) value of `0x04`, your app must support one of the applications listed in the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.nfc.readersession.iso7816.select-identifiers> property list key. Otherwise, the `resultHandler` receives an [`NFCReaderError.Code.readerErrorSecurityViolation`](/documentation/CoreNFC/NFCReaderError-swift.struct/Code/readerErrorSecurityViolation) error.

The session calls `resultHandler` on the dispatch queue that you provided when creating the [`NFCTagReaderSession`](/documentation/CoreNFC/NFCTagReaderSession) object.

---

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)