Skip to content

Commit d2297c0

Browse files
[Auth] Synchronize 'TOTPSecret.openInOTPApp(withQRCodeURL:)' to main actor (#15067)
Co-authored-by: Morgan Chen <[email protected]>
1 parent 54920bc commit d2297c0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

FirebaseAuth/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
- [removed] **Breaking Change**: Remove deprecated Swift APIs using
88
`String`-typed `productID`s that were in favor of API that leverages the
99
`AuthProviderID` enum. Note, this only affects Swift clients.
10+
- [changed] **Breaking Change**: `TOTPSecret.openInOTPApp(withQRCodeURL:)` is
11+
now labeled with `@MainActor` and requires the `await` keyword when called
12+
off of the main actor or main thread.
1013

1114
# 11.15.0
1215
- [fixed] Fixed `Sendable` warnings introduced in the Xcode 26 beta. (#14996)

FirebaseAuth/Sources/Swift/MultiFactor/TOTP/TOTPSecret.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import Foundation
5454
///
5555
/// See more details
5656
/// [here](https://developer.apple.com/documentation/authenticationservices/securing_logins_with_icloud_keychain_verification_codes)
57-
@objc(openInOTPAppWithQRCodeURL:)
57+
@MainActor @objc(openInOTPAppWithQRCodeURL:)
5858
open func openInOTPApp(withQRCodeURL qrCodeURL: String) {
5959
if GULAppEnvironmentUtil.isAppExtension() {
6060
// iOS App extensions should not call [UIApplication sharedApplication], even if

FirebaseAuth/Tests/Unit/SwiftAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class AuthAPI_hOnlyTests: XCTestCase {
553553
let obj = try await TOTPMultiFactorGenerator.generateSecret(with: session)
554554
_ = obj.sharedSecretKey()
555555
_ = obj.generateQRCodeURL(withAccountName: "name", issuer: "issuer")
556-
obj.openInOTPApp(withQRCodeURL: "url")
556+
await obj.openInOTPApp(withQRCodeURL: "url")
557557
}
558558

559559
func FIRTOTPMultiFactorGenerator_h(session: MultiFactorSession, secret: TOTPSecret) {

0 commit comments

Comments
 (0)