---
title: "sendMiFareCommand(commandPacket:completionHandler:)"
framework: corenfc
role: symbol
role_heading: Instance Method
path: "corenfc/nfcmifaretag/sendmifarecommand(commandpacket:completionhandler:)"
---

# sendMiFareCommand(commandPacket:completionHandler:)

Sends a native MIFARE command to the tag.

## Declaration

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

```swift
func sendMiFareCommand(commandPacket command: Data) async throws -> Data
```

## Parameters

- `command`: A MIFARE command. For doc://com.apple.corenfc/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 doc://com.apple.corenfc/documentation/CoreNFC/NFCTagReaderSession object. The handler has the following parameters:

## Discussion

Discussion Use this method to send commands to tags that are from the NFCMiFareFamily.ultralight, NFCMiFareFamily.plus, and 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.

## See Also

### Sending Commands

- [sendMiFareISO7816Command(_:completionHandler:)](corenfc/nfcmifaretag/sendmifareiso7816command(_:completionhandler:).md)
