---
title: "transceive(_:)"
framework: secureelementcredential
role: symbol
role_heading: Instance Method
path: "secureelementcredential/credentialsession/transceive(_:)"
---

# transceive(_:)

Send a wired command Application Protocol Data Unit (APDU) to the credential to complete a transaction or a card content management task.

## Declaration

```swift
func transceive(_ data: Data) async throws -> Data
```

## Parameters

- `data`: The APDU as a doc://com.apple.documentation/documentation/Foundation/Data instance.

## Mentioned in

Accessing and using secure element credentials

## Return Value

Return Value A response APDU.

## Discussion

Discussion Before calling this method, make sure the credential session state is CredentialSession.State.wired(credential:). The state transitions to CredentialSession.State.management if the call encounters a CredentialSession.ErrorCode.resourceUnavailable error; otherwise the state remains unchanged. Use this method to perform the web presentment transaction after calling performWiredTransaction(using:over:instanceaid:). note: When performing a transceive(_:) call, the system grants your app a 15-second grace period from invalidating the session, in the event your app goes into the background.

## See Also

### Performing wired mode actions

- [performWiredTransaction(using:over:instanceAID:)](secureelementcredential/credentialsession/performwiredtransaction(using:over:instanceaid:).md)
- [enterWiredMode(using:)](secureelementcredential/credentialsession/enterwiredmode(using:).md)
- [endWiredMode()](secureelementcredential/credentialsession/endwiredmode().md)
