<!--
{
  "availability" : [
    "iOS: 18.1.0 -",
    "iPadOS: 18.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecureElementCredential",
  "identifier" : "/documentation/SecureElementCredential/CredentialTransaction/performCardEmulationTransactionWithCurrentCredential(options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SecureElementCredential",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:32_SecureElementCredential_SwiftUI0C11TransactionC020performCardEmulationf11WithCurrentC07optionsy0abC00C7SessionC0hI7OptionsV_tYaKF"
  },
  "title" : "performCardEmulationTransactionWithCurrentCredential(options:)"
}
-->

# performCardEmulationTransactionWithCurrentCredential(options:)

Activate the current credential to perform a transaction in card emulation mode.

```
func performCardEmulationTransactionWithCurrentCredential(options: CardEmulationOptions = .init()) async throws
```

## Parameters

`options`

The options to transition the credential to card emulation mode.

## Discussion

Calling this method requires that the credential’s state is `wired`. If successful, the state transitions to [`CredentialSession.State.cardEmulation(credential:)`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/cardEmulation(credential:)). If an error occurs, the state is unchanged, unless the error is [`CredentialSession.ErrorCode.resourceUnavailable`](/documentation/SecureElementCredential/CredentialSession/ErrorCode/resourceUnavailable), which transitions the state back to [`CredentialSession.State.management`](/documentation/SecureElementCredential/CredentialSession/State-swift.enum/management).

When you call this method, the following sequence of events takes place:

1. The system prompts the user to authorize Card Emulation.
2. The system deselects the instance on the wired interface.
3. The system calls the broker interface with authorization information, if applicable. See the integration guide in the [Apple Business Register](https://register.apple.com).
4. The system makes the instance available over the contactless interface and transitions the session to the card emulation state.

This process is guaranteed to preserve contents of the Clear On Reset buffer in the operating system running on the Secure Element. This allows you to create some context in wired mode that remains valid later in card emulation mode.

The caller needs to invoke [`invalidate()`](/documentation/SecureElementCredential/CredentialTransaction/Configuration/invalidate()) after completing each transaction.

> Important: Calling this method may generate a billable event to the credential provider.

> Throws: An ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode``. The most common errors are:
> 
> - ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode/invalidView``: The transaction has no associated scene.
> - ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode/userCanceledAuthorization``: The user dismissed the authorization sheet.
> - ``doc://SecureElementCredential/documentation/SecureElementCredential/CredentialSession/ErrorCode/resourceUnavailable``: The system resource is unavailable.

---

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)