<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreNFC",
  "identifier" : "/documentation/CoreNFC/NFCMiFareTag/sendMiFareCommand(commandPacket:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core NFC"
    ],
    "preciseIdentifier" : "c:objc(pl)NFCMiFareTag(im)sendMiFareCommand:completionHandler:"
  },
  "title" : "sendMiFareCommand(commandPacket:completionHandler:)"
}
-->

# sendMiFareCommand(commandPacket:completionHandler:)

Sends a native MIFARE command to the tag.

```
func sendMiFareCommand(commandPacket command: Data, completionHandler: @escaping @Sendable (Data, (any Error)?) -> Void)
```

## Parameters

`command`

A MIFARE command. For [`NFCMiFareFamily.ultralight`](/documentation/CoreNFC/NFCMiFareFamily/ultralight) commands, you must calculate a 2-byte CRC value and append it to the end of the `command` data.

`completionHandler`

A handler that the reader session invokes after the operation completes. The session calls `completionHandler` on the dispatch queue that you provided when creating the [`NFCTagReaderSession`](/documentation/CoreNFC/NFCTagReaderSession) object.

    The handler has the following parameters:

- response: An <doc://com.apple.documentation/documentation/Foundation/NSData> object containing the tag’s response data for the command.
- error: `nil` when the operation is successful; otherwise, an <doc://com.apple.documentation/documentation/Foundation/NSError> object indicating that a problem occurred while communicating with the tag.

## Discussion

Use this method to send commands to tags that are from the [`NFCMiFareFamily.ultralight`](/documentation/CoreNFC/NFCMiFareFamily/ultralight), [`NFCMiFareFamily.plus`](/documentation/CoreNFC/NFCMiFareFamily/plus), and [`NFCMiFareFamily.desfire`](/documentation/CoreNFC/NFCMiFareFamily/desfire) product families.

This method supports command chaining, passing the full response composed of the individual fragments to the `completionHandler`.

> Note:
> This method doesn’t support the Crypto1 protocol.

---

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)