<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/DeliveredVerificationCodesManager/oneTimeCodes(preferredDuration:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Authentication Services",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:31_AuthenticationServices_SwiftUI33DeliveredVerificationCodesManagerV07oneTimeG017preferredDurationQrSd_tYaKF"
  },
  "title" : "oneTimeCodes(preferredDuration:)"
}
-->

# oneTimeCodes(preferredDuration:)

Stream one-time codes received by the system.

```
@MainActor func oneTimeCodes(preferredDuration: TimeInterval) async throws -> some AsyncSequence<ASVerificationCode, any Error>
```

## Parameters

`preferredDuration`

How long the stream should ideally remain connected. This duration is not guaranteed.

## Discussion

When requested, the user may decide whether your app may receive one-time codes.
This stream will automatically disconnect after a period of time.

> Throws: `DeliveredVerificationCodesManager.VerificationError` if one-time codes can not be delivered.

> Note: Only enabled credential providers may call this method.

---

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)