diff --git a/FirebaseAuth/Sources/Swift/Auth/Auth.swift b/FirebaseAuth/Sources/Swift/Auth/Auth.swift index 5bcbf3eb0cf..8b5212191ef 100644 --- a/FirebaseAuth/Sources/Swift/Auth/Auth.swift +++ b/FirebaseAuth/Sources/Swift/Auth/Auth.swift @@ -1439,7 +1439,7 @@ extension Auth: AuthInterop { return false } - #if os(iOS) + #if os(iOS) && !targetEnvironment(macCatalyst) /** @fn initializeRecaptchaConfigWithCompletion:completion: @brief Initializes reCAPTCHA using the settings configured for the project or tenant. diff --git a/FirebaseAuth/Sources/Swift/User/User.swift b/FirebaseAuth/Sources/Swift/User/User.swift index 2a679a9eb85..e8965a3aa99 100644 --- a/FirebaseAuth/Sources/Swift/User/User.swift +++ b/FirebaseAuth/Sources/Swift/User/User.swift @@ -589,9 +589,9 @@ extension User: NSSecureCoding {} @remarks See `AuthErrors` for a list of error codes that are common to all API methods. */ @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) - public func getIDToken(forcingRefresh forceRefresh: Bool = false) async throws -> String { + public func getIDToken() async throws -> String { return try await withCheckedThrowingContinuation { continuation in - self.getIDTokenForcingRefresh(forceRefresh) { tokenResult, error in + self.getIDTokenForcingRefresh(false) { tokenResult, error in if let tokenResult { continuation.resume(returning: tokenResult) } else if let error { diff --git a/FirebaseAuth/Tests/Unit/SwiftAPI.swift b/FirebaseAuth/Tests/Unit/SwiftAPI.swift index c462ddf2d44..5d8d22331e7 100644 --- a/FirebaseAuth/Tests/Unit/SwiftAPI.swift +++ b/FirebaseAuth/Tests/Unit/SwiftAPI.swift @@ -94,7 +94,7 @@ class AuthAPI_hOnlyTests: XCTestCase { #endif } - func FIRAuth_h() throws { + func FIRAuth_h(credential: AuthCredential) throws { let auth = FirebaseAuth.Auth.auth() let authApp = FirebaseAuth.Auth.auth(app: FirebaseApp.app()!) let user = auth.currentUser! @@ -155,8 +155,10 @@ class AuthAPI_hOnlyTests: XCTestCase { _ = auth.canHandle(URL(fileURLWithPath: "/my/path")) auth.setAPNSToken(Data(), type: AuthAPNSTokenType(rawValue: 2)!) _ = auth.canHandleNotification([:]) - auth.initializeRecaptchaConfig { _ in - } + #if !targetEnvironment(macCatalyst) + auth.initializeRecaptchaConfig { _ in + } + #endif #endif auth.revokeToken(withAuthorizationCode: "A") try auth.useUserAccessGroup("abc") @@ -180,9 +182,11 @@ class AuthAPI_hOnlyTests: XCTestCase { let provider = OAuthProvider(providerID: "abc") #if os(iOS) let credential = try await provider.credential(with: nil) - _ = try await auth.signIn(with: OAuthProvider(providerID: "abc"), uiDelegate: nil) _ = try await auth.signIn(with: credential) - try await auth.initializeRecaptchaConfig() + _ = try await auth.signIn(with: OAuthProvider(providerID: "abc"), uiDelegate: nil) + #if !targetEnvironment(macCatalyst) + try await auth.initializeRecaptchaConfig() + #endif #endif _ = try await auth.signInAnonymously() _ = try await auth.signIn(withCustomToken: "abc") @@ -655,7 +659,6 @@ class AuthAPI_hOnlyTests: XCTestCase { _ = try await user.getIDTokenResult() _ = try await user.getIDTokenResult(forcingRefresh: true) _ = try await user.getIDToken() - _ = try await user.getIDToken(forcingRefresh: false) _ = try await user.link(with: credential) _ = try await user.unlink(fromProvider: "abc") try await user.sendEmailVerification()