performTransaction(using:options:)
Prompts the user for authorization and then activates a credential for card emulation.
Declaration
func performTransaction(using credential: Credential, options: CardEmulationOptions = .init()) async throwsParameters
- credential:
The credential to activate and transition into card emulation state.
- options:
The options to activate the credential with, defaults to none.
Mentioned in
Discussion
If this call succeeds, the session state trasitions to CredentialSession.State.cardEmulation(credential:), and the event stream publishes a CredentialSession.Event.fieldStateChanged(info:) event.
Card emulation ends after 60 seconds, at which point the the event stream publishes a CredentialSession.Event.cardEmulationTimeout event. If you complete your transaction before the timeout, call endCardEmulation() to exit card emulation mode.
The caller needs to invoke invalidate() after completing each transaction.